I have have code (below) which hides/shows elements based upon a radio choice. This works well. It should also reset certain elements values. This works for the upload elements with the ‘reset()’ api but setting the text and number fields values to null doesnt seem to work. Please could you take a look and advise? Thanks
//hide, show and set values
export function radio1_change() {
if ($w(‘#radio1’).value === ‘A’) {
$w(‘#box1’).show();
$w(“#box2”).hide();
$w(“#box3”).hide();
$w(‘#inputNumber’).value === ‘1’;
$w(“#upload1”).reset();
$w(“#upload2”).reset();
$w(“#textComments1”).value === null;
}
else if ($w(‘#radio1’).value === ‘B’) {
$w(“#box2”).hide();
$w(“#box1”).hide();
$w(‘#inputNumber’).value === ‘20’;
$w(‘#box3’).show();
$w(“#inputIDnumber”).value === null;
$w(“#dateDOB”).value === null;
$w(“#radioSex”).value === null;
$w(“#radioSmoking”).value === null;
$w(“#upload3”).reset();
$w(“#upload4”).reset();
$w(“#textComments2”).value === null;
}
else {
$w("#box2").show();
$w('#inputNumber').value === null;
}
}