I need to setup some AND statements into some events, and am now sure how to do it... I know it will have to be something custom.
Psuedo code below:
Psuedo code below:
if (appGender = '0' && appAgeAtApp < '17') {
show parent of appSelServ;
}
Hi moorear,
I don't think that you can do this using the built-in events beyond using them to call a function when the element changes. I got a simple version of this working with this function
You would probably want to extend this to check that an age has been entered.
Bob
I don't think that you can do this using the built-in events beyond using them to call a function when the element changes. I got a simple version of this working with this function
function showBox() {
if ( jQuery('input[name=appGender]:checked').val() == 'm' && parseInt(jQuery('#appAgeAtApp').val()) <= 17 ) {
jQuery('#form-row-appSelServ').show();
} else {
jQuery('#form-row-appSelServ').hide();
}
}
Note that I changed the gender radio to use m & f instead of 0 and 1 as 0 can cause problems. The function is called on Change of the gender buttons and on Typing for the age text input,
You would probably want to extend this to check that an age has been entered.
Bob
Hey Bob, can you give a little bit more information on exactly how you set this up, so I can use it as a template and learn from it? Where do I call the function, etc?
Hi moorear,
You put the function in a Load JavaScript action in the form On Load event - move it up before the HTML (Render Form) action.
Then in the Designer tab click the Events sub-tab and drag across a Function Call event - probably two of them. You can configure this to run the showBox function when the apppGender and appAgeAtApp elements change/are edited.
Bob
You put the function in a Load JavaScript action in the form On Load event - move it up before the HTML (Render Form) action.
Then in the Designer tab click the Events sub-tab and drag across a Function Call event - probably two of them. You can configure this to run the showBox function when the apppGender and appAgeAtApp elements change/are edited.
Bob
This topic is locked and no more replies can be posted.