Form Validation in HTML or PHP

rothana
08:26:10
Dear all value friends,

I'm very new to web development. Please don't mind me if I have a small silly problem to ask for your help. And thank you in advance for your valuable time helping me.

I really need some script or script package to do the form validation in my HTML page. What I need is to show the main message in red color on the top or the bottom of the same page and some other messages right next to the text box.

For example:

****************************
Information:
Name: _______________
Sex: _______________

(Submit Btn)
****************************

If they don't fill in, it will come up like this:

****************************
SUMBIT FAILED!!!

Information:
Name: _______________ (* Required)
Sex: _______________ (* Required)

(Submit Btn)
****************************

I hope I can have some help from all of you very soon. Thank you in advance....

Best luck to you, my friends,
Rothana
smo1234
08-26-2010
You can start from here on posting back and form validation.

There are different ways to do this , now Ajax is used.
rothana
08-26-2010
Dear smo1234,

Thanks for your reply. I have been working on that with my page. It's very helpful and response to what I'm looking for as well. But I'm not skillful, honestly.

I will try my best to work on that again.

Best regards,
Rothana
rothana
08-30-2010
Dear smo1234,

I've got your response to my need.

http://www.plus2net.com/php_tutorial/ajax-form-validation.php

That's the brilliant work. Thank you so much for your help.
Anyway, how can we put the main Error Message on the top every time there is any error?

Eample:

*************************************************
"Failed"

Name: ____________ (You need to type your name)
Sex: ____________ (Field regired)

*************************************************

Best regards,
Rothana
smo1234
08-31-2010
The form validation at http://www.plus2net.com/php_tutorial/ajax-form-validation.php returns one set of error message only so it is displayed all at one location. For Individual form componenet validation we need to get back a set of error message each mapped to each component. Like the error message from radio button has to be displayed by the side of radio button only.

That part will be shortly ready.
smo1234
09-05-2010
Check this validation by using onBlur event of html form

Check the demo and use the tab to move between the form
Please Login to post your reply or start a new topic