I have a form where three properties control the conditional display of three other properties - one is a DropDownList, one a CheckBoxList and one a RadioButtonList (in that order). Making a selection in any of the three properties will show/hide subsequent form fields.
The DropDownList is working fine, the other two throw a javascript error - the CheckBoxList field in the form throws the error on page load load, then the RadioButtonList when a selection is made in either the DropDownList or the RadioButtonList.
Error:
Uncaught TypeError: Cannot call method 'indexOf' of undefined
Code causing the error (standard Contour CheckRules()):
Pretty sure that's caused by the CheckBoxList and RadioButtonList having no default value when the page loads - since both are mandatory fields I can't set a default, as that defeats the purpose of enforcing those fields.
Any suggestions on how I can correct this? The form still functions correctly, I just want to clean up the errors.
Example form is live here - http://www.usc.edu.au/university/jobs-at-usc/how-to-apply/job-application-form [live but not in use - it's an internal demo of a possible solution for online applications], where the fields in questions are title (DropDownList), immigration status (RadioButtonList) and the self identification section (CheckBoxList).
The form submits properly, so it isn't critical to fix, I just don't like seeing errors... Any ideas would be appreciated.
Javascript errors with conditional fields
I have a form where three properties control the conditional display of three other properties - one is a DropDownList, one a CheckBoxList and one a RadioButtonList (in that order). Making a selection in any of the three properties will show/hide subsequent form fields.
The DropDownList is working fine, the other two throw a javascript error - the CheckBoxList field in the form throws the error on page load load, then the RadioButtonList when a selection is made in either the DropDownList or the RadioButtonList.
Error:
Code causing the error (standard Contour CheckRules()):
Pretty sure that's caused by the CheckBoxList and RadioButtonList having no default value when the page loads - since both are mandatory fields I can't set a default, as that defeats the purpose of enforcing those fields.
Any suggestions on how I can correct this? The form still functions correctly, I just want to clean up the errors.
Comment author was deleted
What version of Contour are you running?
We're running 3.0.6 on a 4.11.8 install.
Example form is live here - http://www.usc.edu.au/university/jobs-at-usc/how-to-apply/job-application-form [live but not in use - it's an internal demo of a possible solution for online applications], where the fields in questions are title (DropDownList), immigration status (RadioButtonList) and the self identification section (CheckBoxList).
The form submits properly, so it isn't critical to fix, I just don't like seeing errors... Any ideas would be appreciated.
Comment author was deleted
Hi Nathan,
Looks like this is an old bug so upgrading should get rid of it for upgrade instructions check http://our.umbraco.org/projects/umbraco-pro/contour/documentation/Installation/Upgrade
is working on a reply...