• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Three of Four fields must have a value.

 
LaTeef Lusk
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a script that is not working. I have four form fields, and I want to script to check that at least 3 of the 4 have a value. When I submit the form it seems to bypass the validation. Please help. My script is below: Any help would be appreciated.

 
Paul Clapham
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And it would also help to know what "not working" means. Read this for information about that: ItDoesntWorkIsUseless.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Wow, you can make that code less complicated.

But how are you calling the validation function?

Eric
 
Travis Hein
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yea, if you require 3 fields selected, is it important to know which ones not selected.



and maybe this could be called as
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic