Link to home
Start Free TrialLog in
Avatar of StarThunder
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?
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Please post the form, using the code snippet, thanks.

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.
Avatar of hielo
>>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/
ASKER CERTIFIED SOLUTION
Avatar of Mark Brady
Mark Brady
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
+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/
Avatar of StarThunder
StarThunder

ASKER

Sorry for being so late in this... I had a health problem.