Hello,
It is not an issue, the dependencies affect only the fields in the same form, so, I assume you’re emulating the dependencies between fields in different forms. If it is the case, you simply should trigger programmatically the onchange event in the element that hides the fields in the second form, when the second form is loaded.
If you need a custom coding service do not hesitate in contact me through my private website:
https://cff.dwbooster.com/customization
Best regards.
Thread Starter
Damn!
(@greedymind)
But It was already done, please see the below code:
<script>
jQuery(document).on('change', '.my-unit-dropdown select', function(){
if(jQuery(this).val() == 'Metric')
{
jQuery('.my-auxiliary-kg-field').show().find('input,textarea,select').removeClass('ignore');
jQuery('.my-auxiliary-kg-field-goal').show().find('input,textarea,select').removeClass('ignore');
jQuery('.my-auxiliary-lbs-field').hide().find('input,textarea,select').addClass('ignore');
jQuery('.my-auxiliary-lbs-field-goal').hide().find('input,textarea,select').addClass('ignore');
}
else
{
jQuery('.my-auxiliary-lbs-field').show().find('input,textarea,select').removeClass('ignore');
jQuery('.my-auxiliary-lbs-field-goal').show().find('input,textarea,select').removeClass('ignore');
jQuery('.my-auxiliary-kg-field').hide().find('input,textarea,select').addClass('ignore');
jQuery('.my-auxiliary-kg-field-goal').hide().find('input,textarea,select').addClass('ignore');
}
});
jQuery(window).on('load', function(){
jQuery('.my-unit-dropdown select').change();
});
</script>
-
This reply was modified 8 years, 6 months ago by
Damn!.
Hello,
Please, set a timeout to be sure the form has been rendered before calling the onchange event, for example:
jQuery(window).on('load', function(){
setTimeout(function(){jQuery('.my-unit-dropdown select').change();}, 1000);
});
Best regards.
Thread Starter
Damn!
(@greedymind)
Hello,
Did that and there seems to be no change in the form. I can still see all the 4 fields.
Please check this page: damnripped.com/test
-
This reply was modified 8 years, 6 months ago by
Damn!.
Hello,
In the second form insert a “HTML Content” field with the piece of code below as its content:
<script>
fbuilderjQuery(document).one('showHideDepEvent', function(){
setTimeout(function(){jQuery('.my-unit-dropdown select').change();}, 1000);
});
</script>
And if the issue persists would be required you request a custom coding service for checking your forms code and implement this behavior. Take into account that dependencies between forms is specific to your project and not a feature in the plugin.
Best regards.
Thread Starter
Damn!
(@greedymind)
Hello,
That piece of code did fix the issue. Thanks a lot for the help. You are the best.
-
This reply was modified 8 years, 6 months ago by
Damn!.