i would like to disable the GO button in the html form when there is no text in the textbox.
however when the last character has just been delete, the GO button will not be disable until you leave the focus of the text box.
is there any way to do a realtime trigger?
a simply html form:
<form name="search" action="somepage.php" action="post">
<input name="searchbox" type="text" value="Input here" onchange="JavaScript: checkContent();"/>
<input name="submit_button" type="button" value="GO" onclick="JavaScript: document.search.submit();"/>
</form>
and the javascript is:
function checkContent(){
if(document.search.searchbox.value!="")
document.search.submit_button.disabled=false;
else
document.search.submit_button.disabled=true;
}