Forum Moderators: open
<table>
<tr>
<td class = "divTitle">Job Name:</td>
<td><input type = "text" name = "newJobName" onblur="checkName(this.value, 53)"><br><span id = "newText53"></span></td>
</tr>
<tr>
<td class = "divTitle">Notes:</td>
<td><textarea name = "newNotes"></textarea></td>
</tr>
</table>
<input type = "submit" name = "newSubmit" value = "Add Job"> <!-- onclick="hide('div53')" -->
</form></center>
</div>
All I want is for the submit button to be grayed out or unclickable if either of the two previous text boxes are blank. How would I do that? Thanks,
document.getElementById('someInput').disabled=true; // grays out input
document.getElementById('someInput').disabled=false; // makes input usable again
Since you already have an onblur function being called, you could add an ID to the submit, then toggle that disabled attribute based on the length of the textarea.
Now, it may still be possible to submit the form in some browsers by hitting the enter key, so you should still do an onsubmit for the <form> itself that checks the textareas before allowing the form to be submitted.
Give this a shot and post back your code attempt if you run into trouble. :)