|
-
Jun 1st, 2009, 02:05 AM
#1
Thread Starter
Addicted Member
[RESOLVED] blank fields in a form
I can use empty($var) to identify if a field in a form has been left blank but how would you implement it so the form wouldn't be submited if there were blank fields within the form?
-
Jun 1st, 2009, 02:39 AM
#2
Re: blank fields in a form
wouldn't be submitted at all? you'd need to use JavaScript for that. you could check out a simple way of doing it using this tutorial from w3.
just in case you meant you just didn't want to do anything if any of your fields were empty, you could simply loop through your POST variable, checking if they're empty (using empty() if you'd like!), and if any are you could throw an error and just display the form again, or whatever.
-
Jun 1st, 2009, 04:50 AM
#3
Thread Starter
Addicted Member
Re: blank fields in a form
thanks kows i'll have a look see
-
Jun 3rd, 2009, 03:31 AM
#4
Thread Starter
Addicted Member
Re: blank fields in a form
Sorted
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|