Cross-posting from the programming thread but I've hit a bit of a roadblock.
I have a somewhat rudimentary problem right now with HTML and JS. While I know how to disable a button, I'm not sure on how to make it conditional.
Right now I've got a form.
Code:
<FORM>
<input type="text" id="realtxt"/>
<SELECT id="realitems">
<OPTION value="1">
<OPTION value="max">Enter the highest number
<OPTION value="min">Enter the lowest number
<OPTION value="guess">Guess a number
</SELECT>
<button accesskey="v" id="btnVerify" onclick="result()"> Result </button>
</FORM>
Disabling the button in JS:
Code:
function disable()
{
if(document.getElementById("realitems").value === "1")
document.getElementById("btnVerify").disabled = true;
else
document.getElementById("btnVerify").disabled = false;
};
What I'm assuming is that the value of select is determined by the OPTION value of whatever is chosen in the dropdown menu. If that's true then what I need to make happen those is to execute the JS function in <SELECT> but I'm not sure on how to add the function to it.