Guest User

Untitled

a guest
Feb 21st, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 KB | None | 0 0
  1. try {
  2. Element.update("show_win_new_content", "<h1>New Computer</h1>\n\n<form action=\"/computers/create/?from_window=true\" method=\"post\" onsubmit=\"new Ajax.Request('/computers/create/?from_window=true', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\">\n <div class=\"errorExplanation\" id=\"errorExplanation\"><h2>1 error prohibited this computer from being saved</h2><p>There were problems with the following fields:</p><ul><li>Ip has already been taken</li></ul></div>\n\n<!--[form:computer]-->\n\n<table class=\"streamlined_form\">\n\n \n <tr><td class=\"streamlined_label_cell\"><label class=\"streamlined_label\" for=\"#{record}_#{column.name}\">Name</label></td><td class=\"streamlined_input_cell\"><input id=\"computer_name\" name=\"computer[name]\" size=\"30\" type=\"text\" value=\"Foo\" /></td></tr>\n \n <tr><td class=\"streamlined_label_cell\"><label class=\"streamlined_label\" for=\"#{record}_#{column.name}\">Ip</label></td><td class=\"streamlined_input_cell\"><div class=\"fieldWithErrors\"><input id=\"computer_ip\" name=\"computer[ip]\" size=\"30\" type=\"text\" value=\"192.168.0.101\" /></div></td></tr>\n \n\n</table><!--[eoform:computer]-->\n\n\n\n\n <input name=\"commit\" type=\"submit\" value=\"Create\" />\n</form>\n\n");
  3. } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.update(\"show_win_new_content\", \"<h1>New Computer</h1>\n\n<form action=\\"/computers/create/?from_window=true\\" method=\\"post\\" onsubmit=\\"new Ajax.Request(\'/computers/create/?from_window=true\', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\\">\n <div class=\\"errorExplanation\\" id=\\"errorExplanation\\"><h2>1 error prohibited this computer from being saved</h2><p>There were problems with the following fields:</p><ul><li>Ip has already been taken</li></ul></div>\n\n<!--[form:computer]-->\n\n<table class=\\"streamlined_form\\">\n\n \n <tr><td class=\\"streamlined_label_cell\\"><label class=\\"streamlined_label\\" for=\\"#{record}_#{column.name}\\">Name</label></td><td class=\\"streamlined_input_cell\\"><input id=\\"computer_name\\" name=\\"computer[name]\\" size=\\"30\\" type=\\"text\\" value=\\"Foo\\" /></td></tr>\n \n <tr><td class=\\"streamlined_label_cell\\"><label class=\\"streamlined_label\\" for=\\"#{record}_#{column.name}\\">Ip</label></td><td class=\\"streamlined_input_cell\\"><div class=\\"fieldWithErrors\\"><input id=\\"computer_ip\\" name=\\"computer[ip]\\" size=\\"30\\" type=\\"text\\" value=\\"192.168.0.101\\" /></div></td></tr>\n \n\n</table><!--[eoform:computer]-->\n\n\n\n\n <input name=\\"commit\\" type=\\"submit\\" value=\\"Create\\" />\n</form>\n\n\");'); throw e }
Add Comment
Please, Sign In to add comment