I have a select element in the form with different options. On property of the 'select' is onchange="testRecurrence(this.form)"
and the js function it's just:
function testRecurrence(form) {
if(form.repeat.value != "N") {
form.endR.style.display = 'inline';
}
return true;
}
Being 'repeat' the select and 'endR' the item I want to display in case the option value is not "N". The issue here is that this is not working... been trying to find a solution but not able. Any help?
update
Not working, the element stay always hidden. The element endR by default has display:none
.
update2 js function changed to:
function testRecurrence(form) {
if(form.repeat.options[form.repeat.selectedIndex].value != 'N')
document.getElementById('endR').style.display = 'inline';
}
html:
<select name="repeat" onchange="testRecurrence(this.form)">
...
<div id="endR" style="display: none">
...
</div>
It works now. Thank you.