Hi, i've been racking my brains all day with this, just when i thought i was getting somewhere i realised i'd done it wrong, arrgh! Note: i'm a bit of a noob when it comes to javascript.
Anyway all it is is a basic form which need validating, on the client side, against having some data in. I need to make sure that the first 5 boxes have data in and if they dont then i want the title to the left to change colour to red and just one pop up alert saying "Please fill in the boxes with red text".
The last three boxes dont have to have text in but if they are left blank i would like a default value to be assigned, ie. "field empty"
I managed to get the validation done but i could only get a pop up alert for the each empty field, i.e i got 5 fields popping up after each other.
The other thing, ahhhh...., is that when the form is submitted it submits to another page which loads automatically, which is all good when the fields are filled in correctly. However, what i need is when the validation script picks up an empty field then the page doesnt submit but stays on the form page and focuses on the first empty field with the propmt etc.
Am i asking too much here?? i'll post the form page below just in case it helps. any help would be greatly appreciated.
thanks very much
Pete
Anyway all it is is a basic form which need validating, on the client side, against having some data in. I need to make sure that the first 5 boxes have data in and if they dont then i want the title to the left to change colour to red and just one pop up alert saying "Please fill in the boxes with red text".
The last three boxes dont have to have text in but if they are left blank i would like a default value to be assigned, ie. "field empty"
I managed to get the validation done but i could only get a pop up alert for the each empty field, i.e i got 5 fields popping up after each other.
The other thing, ahhhh...., is that when the form is submitted it submits to another page which loads automatically, which is all good when the fields are filled in correctly. However, what i need is when the validation script picks up an empty field then the page doesnt submit but stays on the form page and focuses on the first empty field with the propmt etc.
Am i asking too much here?? i'll post the form page below just in case it helps. any help would be greatly appreciated.
thanks very much
Pete