Jump to content

Validating a (X)HTML Form


Liquid Fire

Recommended Posts

I don't know if this is the right place but i can't imagine I can do what i want without AJAX/Javascript.  Basically I have a form a user uses to insert some data to a database.  I want to make sure everything is correct and everything is inserted that needs to be and everything that needs to be unique is unique from the database.  The one way i can imagine doing this is to using ajax everytime something in any of the form fields change and when everything is complete and unique, I will display a active submit button and if not i will display a submit button button an inactive one however one of them is a textarea and I am not sure it that is the best method since people can type fast and ajax maybe be a bit to slow.  Is their a faster method for doing this without having to have the user fill in information submit and then i check it and tell the username any errors they made?

Link to comment
https://forums.phpfreaks.com/topic/56041-validating-a-xhtml-form/
Share on other sites

you can add a "Check if unique" link next to the field, so when they finish typing, they can click on that and a small pop-up (or ajax) will check if the username is unique.

 

Also, you can submit the form to a hidden iframe that will either process the form and than redirect the parent window, or will print out a javascript alert with the errors (this way they don't leave the form after they submit unless it's valid).

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.