I thought I have followed all instructions and have no errors in my console. I am trying to hide certain elements unless a certain radio button is clicked. Here is the code.
$w.onReady( function () {
$w( “#MARSTATUS” ).options = [
{ “label” : “Single” , “value” : “Single” },
{ “label” : “Married” , “value” : “Married” },
{ “label” : “Divorced” , “value” : “Divorced” },
{ “label” : “Widowed” , “value” : “Widowed” }
];
$w( “#NMBCHILD” ).options = [
{ “label” : “0” , “value” : “0” },
{ “label” : “1” , “value” : “1” },
{ “label” : “2” , “value” : “2” },
{ “label” : “3” , “value” : “3” },
{ “label” : “4” , “value” : “4” },
{ “label” : “5” , “value” : “5” }
]})
export function MARSTATUS_change(event) {
if (console.log)($w( “#MARSTATUS” ).value === “Married” );
$w( “#SPOUSEALL” ).show();
$w( “#NMBCHILD” ).show();
($w( “#MARSTATUS” ).value === “Single, Divorced, Widowed” );
$w( “#SPOUSEALL” ).hide();
$w( “#NMBCHILD” ).show();
if ($w( “#NMBCHILD” ).value === “0” ) {
$w( “#SUBMIT” ).show();
}
if ($w( “#NMBCHILD” ).value === “1” ) {
$w( “#CHILD1” ).show();
$w( “#SUBMIT” ).show();
}
if ($w( “#NMBCHILD” ).value === “2” ) {
$w( “#CHILD1” ).show();
$w( “#CHILD2” ).show();
$w( “#SUBMIT” ).show();
}
if ($w( “#NMBCHILD” ).value === “3” ) {
$w( “#CHILD1” ).show();
$w( “#CHILD2” ).show();
$w( “#CHILD3” ).show();
$w( “#SUBMIT” ).show();
}
if ($w( “#NMBCHILD” ).value === “4” ) {
$w( “#CHILD1” ).show();
$w( “#CHILD2” ).show();
$w( “#CHILD3” ).show();
$w( “#CHILD4” ).show();
$w( “#SUBMIT” ).show();
}
if ($w( “#NMBCHILD” ).value === “5” ) {
$w( “#CHILD1” ).show();
$w( “#CHILD2” ).show();
$w( “#CHILD3” ).show();
$w( “#CHILD4” ).show();
$w( “#CHILD5” ).show();
$w( “#SUBMIT” ).show();
}
}