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 6723803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:36:45+00:00 2026-05-26T09:36:45+00:00

So, I’m using Facebox 1.3 (latest) I call facebox with a link like this:

  • 0

So, I’m using Facebox 1.3 (latest)

I call facebox with a link like this:

<a href="#dialog" class="comment action_button" rel="facebox">comment</a>

#dialog is a div that looks like this:

<div id="dialog" class="dialog" style="display: none">              
    <form id="redline_form">
        <textarea id="suggested_text" name="suggested_text" style="width: 100%; height: 250px;"></textarea>

        <br>
        <!-- submit button here -->
    </form>

</div>

So, I read that when facebox loads a div into itself, it clones the DOM elements. That would be ok, except for my submit buttons are actually AJAX calls that also submit the form by the form’s ID. and since ID is no longer unique, it submits the original form, rather than the one iside the facebox (which you can get to by adding #facebox to the selectors).

How do I make it so the form remains unique and doesn’t get cloned. or maybe, there is a way to specify the form id in Ruby on Rails’ link_to_remote?

<%= link_to_remote "Submit Comment",
    :url => { :action => :create_redline_comment_or_change, 
    :commit => "Submit Comment" },
    :submit => "redline_form",
    :html => {:id => "comment_submit"} %>

here with the :submit parameter, I tried doing #facebox #redline_form, but it doesn’t know how to interpret that apparently. (no request sent to the server). The way it is now, it sends a request to the server, but it sends the non-facebox form. =\

Using Rails 2.3.8

The relevant Javascript for the workflow displayed here:

    jQuery(".comment").click(function(){
        $j("div#rl_menu").fadeOut(100);

        $j(".original_text").html('' + $selected_text);
        $j("textarea#suggested_text").html("Enter your comment(s) then click submit.");
        $j("#comment_submit").show();
        $j("#change_submit").hide();

        form = $j("#facebox #redline_form_fake");
        form.attr("id", "redline_form");
        form.attr("name", "redline_form");

        field = $j("#facebox #redline_form #suggested_text_fake");
        field.attr("id", "suggested_text");
        field.attr("name", "suggested_text");
    });

EDIT: added code that is supposed to change the ids of the form elements inside the facebox, but it doesn’t work.

  • 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-26T09:36:46+00:00Added an answer on May 26, 2026 at 9:36 am

    My solution: was to instead of load a div that was already on the page (which get’s cloned, and causes issues with multiple elements with the same ID), to put the form into a partial, and load that partial into the facebox.

    For non-web-appers, it’s just loading an URL that contains the div. =D

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I would like to count the length of a string with PHP. The string
this is what i have right now Drawing an RSS feed into the php,

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.