My work's website has a registration form that in one of the questions, ideally, if you click 'Yes' a hidden field suddenly appears and if you click 'No' it disappears.
At the moment, the field is there by default and only disappears AFTER you click 'No' and of course reappears if you click 'Yes'.
What I need is for the field to be HIDDEN ON DEFAULT, with the option of it appearing by clicking 'Yes' or disappearing again by clicking 'No'.
The Yes/No option is a radiobox and the hidden field is actually a container fyi.
I know absolutely nothing about coding or chronoforms and have been thrown in the deep end over the last two days trying to navigate my way around Joomla Form Wizard.
If anybody could please shed some light on what I can change in the code it would be great. The code is currently being used is below and it is used in Events-On Load-Load JS:
"secondApplicant" represents the radiobox ID and "applicant2" represents the ID of the field I wish to hide. Thank You.
At the moment, the field is there by default and only disappears AFTER you click 'No' and of course reappears if you click 'Yes'.
What I need is for the field to be HIDDEN ON DEFAULT, with the option of it appearing by clicking 'Yes' or disappearing again by clicking 'No'.
The Yes/No option is a radiobox and the hidden field is actually a container fyi.
I know absolutely nothing about coding or chronoforms and have been thrown in the deep end over the last two days trying to navigate my way around Joomla Form Wizard.
If anybody could please shed some light on what I can change in the code it would be great. The code is currently being used is below and it is used in Events-On Load-Load JS:
!function($) {
$(document).ready(function() {
$('input[name="[mark]secondApplicant[/mark]"]').click(function(){
if($(this).val() == 'Yes'){
$('.applicant2').show();
}else{
$('.applicant2').hide();
}
});
});
}(window.jQuery);
"secondApplicant" represents the radiobox ID and "applicant2" represents the ID of the field I wish to hide. Thank You.