Hi,
I created a little form on my website that contains a textarea for users to enter comments. Upon clicking submit, my validation function will check various things. I would like to check to see if the user entered anything in the comments section. If they didn't, I'd like to pop-up a confirm dialog box asking if they're sure they want to submit with no comments.
The problem is that I'm not sure how the if condition should look like to check the field. I tried the following but it doesn't seem to work. The <textarea> is named comment and there is no default value for it.
if (form.comment.value == "") {
answer = confirm("No comments entered, are you sure?");
}