Not empty TextArea : TextArea « Form Control « JavaScript DHTML






Not empty TextArea

  
<html>
<head>
<script language="JavaScript">
<!--
function validateForm(f) {
  if (f.value == "") {
     alert("Please enter some text into the feedback field");
     return false;
  }
  else
     return true;
  }
//-->
</script>
</head>
<body>
<pre>
<form name="myForm" method="post" action="http://www.java2s.com" onSubmit="validateForm(myForm.feedback)">
Full Name: <input type="text" size=30 name="persons_name"><br>
Feedback : <textarea name="feedback" rows=5 cols=50></textarea><p>
<input type="submit" value="Send Data">
</form>
</pre>
</body>
</html>


           
         
    
  








Related examples in the same category

1.Textarea rows
2.Is TextArea Multiline
3.TextArea type
4.TextArea wrap
5.TextArea Columns Example
6.TextArea 'value'
7.Select the text in text area
8.Set TextArea to be Active
9.Auto type textarea
10.Methods and Properties of the Textarea Object
11.TextArea on key up event
12.Append text to textarea
13.TextArea on change event
14.TextArea on key down event
15.TextArea on key press event
16.Getting and Setting a Text Object's Value