This project is archived and is in readonly mode.

#4674 ✓invalid
Deleted User

UJS Prototype form_tag remote

Reported by Deleted User | May 23rd, 2010 @ 05:53 PM

form_tag :remote => true still submits the form through normal HTTP. Seems like the JS stops executing once hitting

@@@javascript params = element.serialize(true)


in rails.js (line 11)


Tested with current prototype-ujs and prototype 1.7_rc2

Comments and changes to this ticket

  • Deleted User

    Deleted User May 29th, 2010 @ 12:50 PM

    • Assigned user set to “josh”

    Fix for this issue.

    in the rails.js file, when the submit event of the form gets triggered and the form[remote-data] attribute is present, the handleRemote function gets called. event.stop() is triggered, but there is a missing return false; statement at the end.

    Here are lines 94 till 98 . The only addition I made is adding the return false; statement at the end of the if-statement

    
        var element = event.findElement("form[data-remote]");
        if (element) {
          handleRemote(element);
          event.stop();
          // added return false to stop default form submission
          return false;
        }
    
  • Deleted User

    Deleted User May 29th, 2010 @ 01:22 PM

    After some more testing, seems that the bug still persists. Thinking it might be a prototype problem since I'm running version 1.7_rc2

  • Deleted User

    Deleted User May 29th, 2010 @ 03:10 PM

    Found the problem. Seems like the problem came from a personal library that I use, that conflicted with the new prototype. Ticket can be closed.

  • Rohit Arondekar

    Rohit Arondekar June 15th, 2010 @ 09:52 AM

    • State changed from “new” to “invalid”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Pages