vineet
03-22-2009, 04:42 AM
hi all
i have two date fields which i dont want to get clear after submitting.
actually i have two buttons which perform different functions like one button will show records and if records are
corect then on click of second buton the email will be send but will work only if both my fields are filled.
so in this case the user has to enter informtaion in both fields again and again. thats why i dont want the fields
information entered to be clear on submit.
vineet
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript">
function validate()
{
if(document.form1.datef.value=='')
{
alert("enter first date");
document.form1.datef.focus();
return false;
}
if(document.form1.dates.value=='')
{
alert("enter second date");
document.form1.dates.focus();
return false;
}
}
</script>
</head>
<body>
<table width="901" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form action="" method="post" enctype="multipart/form-data" name="form1" id="form1" onsubmit="return
validate()">
<table align="center" cellpadding="4" cellspacing="0">
<tr>
<td height="30"><table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="192">Select first date </td>
<td> </td>
<td width="190">Select second date </td>
</tr>
<tr>
<td><input type="text" name="datef" id="datef" /></td>
<td width="27">to</td>
<td><input type="text" name="dates" id="dates" /></td>
<td width="191"><input type="submit" name="record" value="see records" />
<input type="submit" name="submit" value="send email" /></td>
</tr>
</table></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
i have two date fields which i dont want to get clear after submitting.
actually i have two buttons which perform different functions like one button will show records and if records are
corect then on click of second buton the email will be send but will work only if both my fields are filled.
so in this case the user has to enter informtaion in both fields again and again. thats why i dont want the fields
information entered to be clear on submit.
vineet
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script language="javascript">
function validate()
{
if(document.form1.datef.value=='')
{
alert("enter first date");
document.form1.datef.focus();
return false;
}
if(document.form1.dates.value=='')
{
alert("enter second date");
document.form1.dates.focus();
return false;
}
}
</script>
</head>
<body>
<table width="901" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><form action="" method="post" enctype="multipart/form-data" name="form1" id="form1" onsubmit="return
validate()">
<table align="center" cellpadding="4" cellspacing="0">
<tr>
<td height="30"><table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="192">Select first date </td>
<td> </td>
<td width="190">Select second date </td>
</tr>
<tr>
<td><input type="text" name="datef" id="datef" /></td>
<td width="27">to</td>
<td><input type="text" name="dates" id="dates" /></td>
<td width="191"><input type="submit" name="record" value="see records" />
<input type="submit" name="submit" value="send email" /></td>
</tr>
</table></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>