Guest ti2d Posted June 15, 2006 Share Posted June 15, 2006 Does anyone have a simple script that automatically checks if any field in a form is empty? The help is really appreciated. Link to comment Share on other sites More sharing options...
DarkElf Posted June 15, 2006 Share Posted June 15, 2006 This is normally something you'd do with javascript before the form has been posted, but if you want to do it with php then you could use a simple if statement to test each field. The best way to do it would be an if with an is not (=!) clause to which will return true if the value isn't empty. Something like: if($_POST('fieldname') =! ''){code to be executed} This can be followed by an else clause if you want it to do something special if the field is empty. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now