LuckySyringe
Technical User
I might be going about this all wrong, but I'm attempting a script that will enable a radio button once a specific query is typed into a text input box. I've added a small (non-working) sample, and as you can probably tell, javascript isn't my strong point...
... If it were earlier on in the day I would probably have been able to write a better script, my logic gets worse as the day progresses.
Code:
<script type="text/javascript">
function checkText() {
var code = document.getElementById("txtCode")
var special = document.getElementById("radSpecial")
if (code = "special code")
{
special.disabled = false;
}else{
special.disabled = true;
}
}
</script>
<form name="test_form">
<input type="text" id="txtCode" onkeyup="checkText()" /><br />
<input type="radio" id="radSpecial" name="radios" value="special" disabled="disabled" /> A |
<input type="radio" name="radios" value="normal_1" /> B<br />
<input type="radio" name="radios" value="normal_2" /> C |
<input type="radio" name="radios" value="normal_3" /> D
</form>
... If it were earlier on in the day I would probably have been able to write a better script, my logic gets worse as the day progresses.