Jump to content

Submit button events


amavadia

Recommended Posts

I have a form on my page with various elements and have created a seperate validate php page. At the bottom of my form I have a button (type="button"). When it is clicked, the data is posted to the validate page, and errors returned. If errors are returned it displays them, if not I want it to post and redirect to another page like a normal form. The problem I have is when I use a type="button" button, the first part works fine but obviously it does not post and redirect because it is not a submit button, but if I change the button type to submit, the .click() handler on the button does not seem to be firing and so the page is posted even without checking for errors.

 

Should i be using a different handler on the submit button as opposed to a button button?

Link to comment
https://forums.phpfreaks.com/topic/258249-submit-button-events/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.