Can anybody tell me how to modift the following script so to put a blank list option at the top of the select element without a value or name?
I am not very good with Javascript and have tried to do this but it seems to ruin the code.
Also I the description text "inches" at the end of the text box that appears and dissapperas with the box.
<form>
<select size="1" onchange="
var lbl = document.getElementById('myLabel');
if (this.selectedIndex==0) {
myText.style.visibility='hidden';
} else {
myText.style.visibility='visible';
}
lbl.style.visibility = myText.style.visibility;
return true;">
<option selected>No</option>
<option>Yes</option>
</select>
<span id="myLabel" style="visibility:hidden">Enter
text:</span>
<input type="text" name="myText" size="20"
style="visibility:hidden">
</form>
Thanks for your help!!
I am not very good with Javascript and have tried to do this but it seems to ruin the code.
Also I the description text "inches" at the end of the text box that appears and dissapperas with the box.
<form>
<select size="1" onchange="
var lbl = document.getElementById('myLabel');
if (this.selectedIndex==0) {
myText.style.visibility='hidden';
} else {
myText.style.visibility='visible';
}
lbl.style.visibility = myText.style.visibility;
return true;">
<option selected>No</option>
<option>Yes</option>
</select>
<span id="myLabel" style="visibility:hidden">Enter
text:</span>
<input type="text" name="myText" size="20"
style="visibility:hidden">
</form>
Thanks for your help!!