Welcome Guest, Not a member yet? Register   Sign In
Form Validation - Require at least 1 of 2 fields to be filled in
#1

[eluser]CroNiX[/eluser]
Basically the title states the question. I have a form and with 2 of the fields, at least one (or both) need to have a value. Is this best solved with a callback function or is there a better way?

Thanks.
#2

[eluser]moodh[/eluser]
[quote author="CroNiX" date="1238885384"]Basically the title states the question. I have a form and with 2 of the fields, at least one (or both) need to have a value. Is this best solved with a callback function or is there a better way?

Thanks.[/quote]

Nothing forces you to actually use the form validation library =)
if(strlen(field1) > 0 || strlen(field2) > 0) {
blabla
}

Wink
#3

[eluser]CroNiX[/eluser]
Yes, but the other 9 fields on the form are using the validation, so it would be nice to be able to use it here too.




Theme © iAndrew 2016 - Forum software by © MyBB