Reputation: 41
I have an instance in which I use the event of clicking the submit button to populate a field in my form with value. But, now, I can't get the form to submit at the same time. What can I do?
Upvotes: 0
Views: 104
Reputation: 73031
Your event handler returns false
. Event handlers should return anything other than false
or nothing in order for the default behavior to occur.
This article might be a good read for you.
Upvotes: 2
Reputation: 2328
That last return false
is preventing the form from submitting. Once you pull that out, it should run just fine. You may also want to consider updating the form field with the JSON inside the first onclick event, that way you don't have to do anything special on submit.
Upvotes: 1
Reputation: 88697
Just don't return false
from your form's submit handler.
Not a lot more to say than that...
Upvotes: 10