This topic is locked
[SOLVED]

 Validation on 3 Text fields

11/1/2012 6:27:09 AM
PHPRunner General questions
I
Ivan van Oosterhout author

Hello,
Can somebody advise me on validation on 3 textfields.


Minimum 1 of the 3 text fields needs to be filled in with a number.
or else they cannot go on or save in edit of add pages.
Kind regards,
Ivan

khalil 11/1/2012



Hello,
Can somebody advise me on validation on 3 textfields.

Minimum 1 of the 3 text fields needs to be filled in with a number.
or else they cannot go on or save in edit of add pages.
Kind regards,
Ivan


Hello Ivan,
This can be established by adding a custom validation on the "Before" event, for example if it's the ADD page then you need to add this on the "Before Record Added" event
try the following:
function BeforeAdd($values,$message,$inline,$pageObject)

{

if ($values['pal'] == "" && $values['ctn'] == "" && $values['goh'] == "") {return false; } else {return true;}

}
I haven't tested the code but it should work fine.
PS: I'm considering that your field names are "pal" and "ctn" and "goh" ... if otherwise change the $values array accordingly.
Cheers!
Khalil

I
Ivan van Oosterhout author 11/1/2012

Hello Khalil
Many Thanks,
You pointed me to the good direction.
kinds regards,
Ivan

khalil 11/1/2012



Hello Khalil
Many Thanks,
You pointed me to the good direction.
kinds regards,
Ivan


Glad to help Ivan !
Good luck <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=68374&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />