I am having trouble figuring out if a TextArea is set(In other words if it has a value). I found most of this information by researching it on Google. I would like the action of a form to change when a TextArea has text added. For some reason my code is not working correctly. Could you explain what I need to change? Here is my HTML and Javascript:
HTML:
<form action="?AddToQuote" method="POST" id="myForm">
<textarea cols="75" rows="6" name="comments" class="comments" id="comments">
</textarea></form>
Javascript:
var comments = document.getElementById("comments");
var commentsVal = comments.val();
if(commentsVal !== null) {
document.myForm.action = "?Email";
}