Adding a link_to_remote
to load a modal dialog box from a partial resulted in an error message when running the application.
RJS error:
TypeError: $("create_event_dialog").dialog is not a function
After clicking ok, another dialog box appeared.
Element.update("create_event", "<form action=\"/countries\" class=\"new_country\" id=\"new_country\" method=\"post\" onsubmit=\"new Ajax.Request('/countries', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;\"><div style=\"margin:0;padding:0;display:inline\"><input name=\"authenticity_token\" type=\"hidden\" value=\"qWXCu2zMmlMhJG+GRf35kMbAIfzYAtFBee142ThmmMw=\" /></div>\n <p>\n <label for=\"country_name\">Name</label><br />\n <input id=\"country_name\" name=\"country[name]\" size=\"30\" type=\"text\" />\n </p>\n <p>\n <input id=\"country_submit\" name=\"commit\" type=\"submit\" value=\"Create\" />\n </p>\n</form>\n");
$('create_event_dialog').dialog({
title: 'New Event',
modal: true,
width: 500,
close: function(event, ui) { $('create_event_dialog').dialog('destroy') }
});
The error occurred with the div having the id of create_event_dialog
. Using Prototype, I am struggling to find a solution. Assistance would be greatly appreciated.