Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Textarea Validate

Status
Not open for further replies.

paragvshah

Programmer
Joined
Jan 11, 2001
Messages
109
Location
IN
Hi friends,

I have done my site in coldfusion & i want to validate a textarea field on a page that if it is blank then it should give a alert message as there is no validate parameter in coldfusion as it is for textfield. can any provide any javascript validation for this.

parag.
 
I guess this should help

<html>
<head>

<script language=&quot;javascript&quot;>
function validate(somArg)
{
If (somArg.textarea2.value==&quot;&quot;)
{
alert(&quot;textArea is blank&quot;);
}
}
</script>

</head>
<body>
<form name=&quot;MyForm&quot;>
<p>
<TEXTAREA rows=2 cols=20 id=textarea2 name=textarea2>
</TEXTAREA><br>
<input type=&quot;submit&quot; onClick=&quot;validate(this.MyForm)&quot;>
</p>

</form>
</body>
</html>

;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top