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
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).

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.