faqts

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

5 of 6 people (83%) answered Yes
Recently 5 of 6 people (83%) answered Yes

Entry

How do i validate whether there is a data entered in text field or not....?

Mar 20th, 2002 10:56
Saravpreet Minhas, Lakshmi Alluri,


write the following code in head tag

<script>
function check()
{
if (document.frm1.text1.value=="")
{
alert("text field is empty")
return false;
}
}
</script>

write the following code in body tag

<body>
<form name="frm1" onsubmit="return check()">
<input type=text name="text1">
<input type=submit>
</body>