[SOLVED] Validation Noempy Field Element Condition + Solution

Status
Not open for further replies.

marcq

Member
Hi,

I have a quite complex situation with creating noempty conditions 4 for text field elements :

Rule should be :

If the 3 "Non" are clicked, then the 4 text field elements shouldn't be mandatory
Else (if minimum 1 "Oui") the 4 text field elements should be mandatory if checkbox is not checked

upload_2016-1-15_9-44-37.png

I have tried several scenario, the last was this one without success :

Code:
return '{gprh_fabrik_user_enrollment___maturite_projet}' == 0 &&  '{gprh_fabrik_user_enrollment___ouverture_etabl}' == 1 &&  '{gprh_fabrik_user_enrollment___reprise_expl}' == 1 &&   '{gprh_fabrik_user_enrollment___reprise_expl}' == 1;

Would appreciate some advise.

Thanks in advance and Cheers,

Marc
 
No problem, that's what a Pro sub is for. An extra pair of eyes always helps.

-- hugh

Hi,

I just checked the result and it works partially. I have a problem with the checkbox value.

When checkbox value == 1, the 4 text fields are not mandatory, when checkbox value == 0 then they are, if a minimum of one of the three radiobutton value is == 1.

http://www.screencast.com/t/2dYi3X8vNx

Code:
return '{gprh_fabrik_user_enrollment___maturite_projet}' == 0 && '{gprh_fabrik_user_enrollment___ouverture_etabl}' == 1 ||  '{gprh_fabrik_user_enrollment___reprise_expl}' == 1 ||   '{gprh_fabrik_user_enrollment___exploitant_etabl}' == 1;

Thanks in advance for you support.

Cheers, Marc
 
Hi,

I couldn't solve this issue. I know it is certainly trivial, but I'm stuck now. So if someone have a good idea, I would appreciate some explanation why it doesn't work.

Thanks,

Marc
 
You may need to put parens around the three 'or' tests, to establish the precedence. So "test1 and (test2 or test3 or test4)"

Hugh

Sent from my Nexus 7 using Tapatalk
 
You may need to put parens around the three 'or' tests, to establish the precedence. So "test1 and (test2 or test3 or test4)"

Hugh
Sent from my Nexus 7 using Tapatalk

Thank you Hugh it works fine now Marc

Solution is :

Code:
return '{gprh_fabrik_user_enrollment___maturite_projet}' == 0 &&('{gprh_fabrik_user_enrollment___ouverture_etabl}' == 1 ||  '{gprh_fabrik_user_enrollment___reprise_expl}'  == 1 || '{gprh_fabrik_user_enrollment___exploitant_etabl}'  == 1) ;
 
Last edited:
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top