In the form of my site, I have a textarea field and a submit button. Here is the code for both:
<textarea name='texto1' id="txtBriefing" rows="5" style="font-family: Trebuchet MS; font-size: 16px; width: 394px; height: 100px" onkeyup="doSomething(this.value)" ></textarea>
<input name="btnEnvia" type="submit" value="Enviar" style="font-family: Trebuchet MS; font-size: 20px" />
However, I would like this button to only be enabled if textarea txtBriefing
is not empty. I have tried some javascript codes with the onkeyup
and onchange
functions searching the internet, but none worked so far.
What can be done for this case?