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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Validation of a textarea

Status
Not open for further replies.

NiteCrawlr

Programmer
Mar 16, 2001
140
BR
Hi,

This might be easy, but I don't know how can I check if a textarea is blank or it has something written in it.

I've tried:

if (eventfrm.EVENT_DETAIL.value == "")
{
alert("É necessário digitar uma descrição !");
eventfrm.EVENT_DETAIL.focus();
return (false);
}

then I've tried:

if (eventfrm.EVENT_DETAIL == "")
{
alert("É necessário digitar uma descrição !");
eventfrm.EVENT_DETAIL.focus();
return (false);
}

and also some other ways which I don't remeber.

please help

NiteCrawlr
 
I used this validation and it's works

if (document.form.text_area.value == "")
{
alert("...");
document.form.text_area.focus ( );
document.form.text_area.select( );
return false;
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top