0

My problem is simple, yet annoying. Instead of sending form data to the server, I just want to access the entered data on the front end. I figured I could do that by using the parameters that show up after I submit the form.

My jQuery submit event, however, is executing before the parameters change on the URL! My logic, then, doesn't use the correct data. How do I fix this? See below:

listen: function() {
  $('form').submit(this.init.bind(this))
}

I need the URL parameters to change first, then have this event execute! How do I fix it?

anders32
  • 295
  • 1
  • 4
  • 11

1 Answers1

0

You could put a delay on it. Probably more effective, you could simply use .serialize().

Source

Community
  • 1
  • 1
Ryan Killeen
  • 120
  • 6
  • 1
    Serialize works beautifully. The key is to not get the data from the URL if you need it before the submit event finishes! THANK YOU! – anders32 Sep 25 '14 at 01:41