This topic is locked
[SOLVED]

 Required Field if different field value =

7/29/2020 6:22:40 PM
PHPRunner General questions
M
mhollibush author

I have two fields:

country and state
by design - state is hidden unless country = "236"



var ctrl = Runner.getControl(pageid, "country");

if(ctrl.getValue() != "236")

pageObj.hideField("state");

ctrl.on('change', function(){

if (this.getValue() == "236"){

pageObj.showField("state");

}

else {

pageObj.hideField("state");

}

});


What I need to add to this is making "state" required if country = "236"
any help would be greatly appreciated

Sergey Kornilov admin 7/29/2020
HJB 7/29/2020

https://xlinesoft.com/phprunner/docs/show_dropdown_list_of_us_states.htm
... in regard to "country" and "state", assuming a dropdown list at your end.
https://asprunner.com/forums/topic/24116-hide-multiple-fields/
FYI only, a 2016 dated thread from your end on the very same issue.

M
mhollibush author 7/29/2020



Check the first example at https://xlinesoft.com/phprunner/docs/ctrl_addvalidation.htm


PERFECT....

Dug a little deeper and was able to achieve the desired results - Thanks <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=92137&image=1&table=forumreplies' class='bbc_emoticon' alt=':)' />

M
mhollibush author 7/30/2020



https://xlinesoft.com/phprunner/docs/show_dropdown_list_of_us_states.htm
... in regard to "country" and "state", assuming a dropdown list at your end.
https://asprunner.com/forums/topic/24116-hide-multiple-fields/
FYI only, a 2016 dated thread from your end on the very same issue.


yes... search all over for it, but couldn't find it... sorry for the double post...