Results 1 to 4 of 4

Thread: [RESOLVED] blank fields in a form

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    156

    Resolved [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?

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    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.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    156

    Re: blank fields in a form

    thanks kows i'll have a look see

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Mar 2009
    Posts
    156

    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
  •  



Click Here to Expand Forum to Full Width