Not empty TextArea : TextArea : Form Control : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
PHP
JavaScript DHTML Home »  Form Control   » [  TextArea  ]   
 



Not empty TextArea

Please note that some example is only working under IE or Firefox.

/*
Javascript Essentials
by Jason J. Manger

Publisher: Mcgraw-Hill Osborne Media; 

ISBN: 0078822343
*/

<!--
  Program 5-9
  Author Note:
  The host www.somehost.com is hypothetical in this example. The
  process_form.pl file should reside on a host that supports the
  Perl language. See the file process_form.pl for the scripts
  source code.
-->
<html>
<head>
<script language="JavaScript">
<!--
function validateForm(f) {
  if (f.value == "") {
     alert("Please enter some text into the " +
           "feedback field");
     return false;
  }
  else
     // Ok, let the form submit the data:
     return true;
  }
//-->
</script>
</head>
<body>
<pre>
<form name="myForm"
      method="post"
      action="http://www.somehost.com/cgi-bin/process_form.pl"
      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
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.