StarThunder
asked on
Form Acceptance
I have a form, a couple of the fields NEED to be filled with something.
I used REQUIRED on the form, and pressed the submit button to go to the next page, and it let me. Bypassing any "required" fields.
I need to be able to disable the "SUBMIT" button I think, until my requirements are met for the other 2 fields. I need these 2 fields not to be blank because one is a Unique index, and one is a main picture that is an ANCHOR for another page.
Then again is this even the right thought process?
I used REQUIRED on the form, and pressed the submit button to go to the next page, and it let me. Bypassing any "required" fields.
I need to be able to disable the "SUBMIT" button I think, until my requirements are met for the other 2 fields. I need these 2 fields not to be blank because one is a Unique index, and one is a main picture that is an ANCHOR for another page.
Then again is this even the right thought process?
>>Then again is this even the right thought process?
No. You are relying on client-side validation. I can create a perl script and emit a "submit" of your form without your required fields.
Thus, what you really need to do is validate the submitted data on the server and refuse to proceed until your requirements are met. Here's a page that shows the principle in action:
http://w3epic.com/how-to-validate-form-with-php-server-side-validation/
No. You are relying on client-side validation. I can create a perl script and emit a "submit" of your form without your required fields.
Thus, what you really need to do is validate the submitted data on the server and refuse to proceed until your requirements are met. Here's a page that shows the principle in action:
http://w3epic.com/how-to-validate-form-with-php-server-side-validation/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
+1 for what Elvin66 writes here. These might be useful links. (Several useless links were deliberately omitted!)
http://jqueryvalidation.org/
http://speckyboy.com/2009/12/17/10-useful-jquery-form-validation-techniques-and-tutorials-2/
http://jqueryvalidation.org/
http://speckyboy.com/2009/12/17/10-useful-jquery-form-validation-techniques-and-tutorials-2/
ASKER
Sorry for being so late in this... I had a health problem.
You may want to use jQuery for a good client-side experience. Whether or not you choose that, you must validate the input on the server-side.