Form validation
Posted: Mon Apr 11, 2005 3:05 pm
I'm coding a game using PHP and need some form validation, I think javascript might be the way to go and I know almost nothing about that so wondered if anyone could help me please?
First of all, I want the submit button on form 1 to be grayed out until the user completes all the required fields.
Secondly, on form 2 I want the submit button grayed out until the total entered in four boxes equals 100. There are four boxes where the user can enter numbers and they must total 100. If it could also check for negative values that would be nice but not vital.
I will be using php to validate the input once it reaches the server just in case people have js turned off etc, but I think it would be nice to have the grayed out buttons to make it as easy as possible for the user.
Thanks very much!
First of all, I want the submit button on form 1 to be grayed out until the user completes all the required fields.
Secondly, on form 2 I want the submit button grayed out until the total entered in four boxes equals 100. There are four boxes where the user can enter numbers and they must total 100. If it could also check for negative values that would be nice but not vital.
I will be using php to validate the input once it reaches the server just in case people have js turned off etc, but I think it would be nice to have the grayed out buttons to make it as easy as possible for the user.
Thanks very much!