form validator question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
mit
Forum Commoner
Posts: 32
Joined: Mon Sep 15, 2008 6:37 am

form validator question

Post by mit »

i m using ;

Code: Select all

var frmvalidator = new Validator("register_form");
frmvalidator.addValidation("name","req","Please enter you name!");
to validate the form , but I have 4 field which are radio button like
1.Gender: Male Female
2.Race: Chinese Indian Others
3...
4...

how can i use this form for these 4 radio button, any ideas?
User avatar
papa
Forum Regular
Posts: 958
Joined: Wed Aug 27, 2008 3:36 am
Location: Sweden/Sthlm

Re: form validator question

Post by papa »

frmvalidator.addValidation("gender","req","Please enter your sex you monkey!");

Don't know what req does, but as the look of it, it sees wether the variable is empty or not and in this case to see if the user has selected anything.
mit
Forum Commoner
Posts: 32
Joined: Mon Sep 15, 2008 6:37 am

Re: form validator question

Post by mit »

no this is not the way
Post Reply