For Regular JavaScript, one would have the following:
An onkeyup even for the textbox (I happen to like key-up), adding an 'onchange' is also OK in case of a cut-and pasted
An ID for your button
In the handler for the onkeyup/onchange events, use DOM to enable/disable button based upon its content (such as via
.length). Personally, I always test for content after trimming white-space from a copy of the string internal to be sure there's really an entry in the box.
A parallel example:
http://www.w3schools.com/jsref/prop_pushbutton_disabled.asp[
^]
document.getElementById("theButtonID").disabled=false;