Need another set of eyes

Hi, This is driving me crazy. I have a small form I am trying to validate and it will not validate the <textarea> field for some reason. All the <input> fields work fine.

What am I missing?

Here is my code for the text area:

<script>
if (form.message.value == "" || form.message.value == "message*") {
alert("Please enter a message.");
form.message.focus();
return false ;
}
</script>

<textarea id="message" name="message">message*</textarea>

Thank you.

Try using the following instead

if (form.message.innerHTML == "" || form.message.innerHTML == "message*") {

Your code seems to work perfectly well when it’s used within an appropriate context:


<form id="myform">
	<textarea id="message" name="message">message*</textarea>
	<input type="submit">
</form>
<script>
document.getElementById('myform').onsubmit = function () {
	var form = this;
	if (form.message.value == "" || form.message.value == "message*") {
		alert("Please enter a message.");
		form.message.focus();
		return false;
	}
}
</script>

Can you show us more of how you’re using your code? Perhaps, by providing us with a link to a test page?