Hello,
I have the part of code presented below.
It has 2 radiobuttons and 2 text inputs.
When user selects the first radiobutton(value="searchw"), I would like to make textsearch1 enabled and textsearch2 disabled.
And the opposite process..
when user selects the second radiobutton(value="searcht") I would like to make textsearch2 enabled and textsearch1 disabled.
html code:
<form name="definesearch" action="#" method="post">
<br />
<br/>
<table>
<tr>
<td><input type="radio" name="searche" value="searchw" />
search writer</td>
<td><input type="text" name="textsearch1" onkeyup="writer(this.value)" disabled="disabled"/></td>
</tr>
<tr>
<td><input type="radio" name="searche" value="searcht" />
search themes</td>
<td><input type="text" name="textsearch2" onkeyup="themes(this.value)" disabled="disabled"/></td>
</tr>
</table>
<br/><br/>
</form>
and here is my javascript effort (which is maybe wrong?? it doesn't work :( )
<script>
function definesearchmode()
{
if (document.definesearch.searche.searchw.checked=true)
{
document.definesearch.textsearch1.disabled=false;
document.definesearch.textsearch2.disabled=true;
}
else if (document.definesearch.searche.searcht.checked=true)
{
document.definesearch.textsearch1.disabled=true;
document.definesearch.textsearch2.disabled=false;
}
}
</script>
I call the script from here: <body onLoad="definesearchmode()" >
I am newbie to javascript, code has some errors probably that I don't know how to figure it out...
Any help would be appreciated :)