how can i make it so that on my register page all forms have to have something typed in and all drop down boxes have to select something besides the default?
also how can i make it so it displays a javascript box that says Email Addresses don't match if Email Address and Confirm Email Address dont match? Same thing with password and confirm password
thanks,
matt
form help
Moderator: General Moderators
Sounds like you need a javascript solution....
In the from tag ad onsubmit="checkForm();"
Then build the function.
It would look something like that...
There are lots of toots on the web for stuff like this.
In the from tag ad onsubmit="checkForm();"
Then build the function.
Code: Select all
function checkForm(){
if (document.formname.fieldname.value == ""){ ///Check the value of the field
window.alert('some message');
}
}There are lots of toots on the web for stuff like this.
- trukfixer
- Forum Contributor
- Posts: 174
- Joined: Fri May 21, 2004 3:14 pm
- Location: Miami, Florida, USA
I dont rely on javascript for that - I post the data to the handler script, (typically posts back to itself) and then check post data for parameters (empty values, dirty data, numbers where you only want letters, etc) and assign errors to an array (or a string) and re-display the form prepopulated with the previously submitted data (and using CSS to highlight in an "alert" color, the fields that gave errors, along with the error messages) whe they get all teh data required submitted (and cleaned somewhat) I assign all data to SESSION data and redirect to the php script that processes the data and does whatever with it, then redirect to whatever "results" page I want to display to them - it's a lot more work that using JavaScript, but if it is mission critical data, it's a heck of a lot more secure (A user can just turn off JavaScript and still submit dirty data or empty data to your form, or post it from another form that doesnt have JavaScript on it, so JavaScript is at best just a "page pretty-upper" - there *are* some uses for Javascript that help enhance security quite well, but none of it does any form input validation 
Check out Zoopframework
It has integrated form validation using it's guiControls component. It integrates both javascript and php validation and supports required and many different format typing like phone, creditcard, numeric, etc...
GuiControls work using normal posts, or through AJAX.
You can find zoop at http://zoopframework.com. It has pretty extensive documentation and also has a forum where you can get help.
They even have a movie there to show you the form validation in action.
It has integrated form validation using it's guiControls component. It integrates both javascript and php validation and supports required and many different format typing like phone, creditcard, numeric, etc...
GuiControls work using normal posts, or through AJAX.
You can find zoop at http://zoopframework.com. It has pretty extensive documentation and also has a forum where you can get help.
They even have a movie there to show you the form validation in action.