Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6603201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:58:38+00:00 2026-05-25T18:58:38+00:00

I add a link_to_remote to load a modal dialog box from a partial. But

  • 0

I add a link_to_remote to load a modal dialog box from a partial. But when I run the application I get the following error..

RJS error:

TypeError: $("create_event_dialog").dialog is not a function

When I click ok then again I got another dialog box.

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') }

});

Why do I got this kind of error? I have a div with the id of create_event_dialog. I am using Prototype and I could not find the way to solve this. Please help me.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T18:58:39+00:00Added an answer on May 25, 2026 at 6:58 pm

    Your code looks like you want to actually use the jQuery UI dialog feature. As far as I know Prototype (or Scriptaculous) has no built-in dialog support.

    If want to have a jQuery UI dialog you have two options:

    1. Use jQuery and jQuery UI alongside Prototype.
    2. Replace Prototype and only use jQuery

    Option 1:

    To use jQuery alongside Prototype you have to include the jQuery Javascript libraries and enable the compatibility mode by calling jQuery.noConflict(). After that the $ function belongs to Prototype and for all jQuery features you have to use jQuery(...) instead. For example jQuery('create_event_dialog').dialog(... in your case.

    You can find details on Using jQuery with Other Libraries.

    Option 2:

    You have to remove the Prototype libraries and instead include the jQuery libraries. You also need the jRails compatibility library to keep your prototype helpers. And you have to change your existing Prototype code to jQuery code.

    For example your Element.update statement would look like this:

    $("#create_event".html("<form action=...")
    

    See Using jQuery with Ruby on Rails for more details.

    Careful: Depending on your existing code option 2 can be a lot of work, but will result in cleaner Javascript code. Also it might be worth considering switching to Rails 3.1 with UJS and jQuery as the official Javascript library.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using rails 2.3.8 and I'll load a modal dialog box using a
I have the following bit of code, simply: $(function() { $('a.add-photos-link').live('click', function(e) { $(this).colorbox({
link_to_remote has an :href option to unobtrusively add regular links just in case javascript
how do i add styles to actionviews helper tags. like the following <%= link_to
Given the following: <%= link_to Add, group_request_path(gr), :confirm => Are you sure?, :method=> :put,
i want load Content(is html) with jQuery. why following code not worked for me?
I've got to add a new row with it's content populated from an ajax
Hi I am using this code to get some data from ebay . string
If i have img element id = myimg. Is posible to add link to
I am using preg_replace to add a link to keywords if they are found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.