[thelist] Fomated tet box question - solution
Brian Delaney
brian.delaney at mccmh.net
Wed Mar 9 13:39:27 CST 2005
This was much easier than I would have thought , here is the code:
<td colpan=4>
Episode Date:
<td width=20%>
<input style="border: thin inset;" type="text" name="txtEDay" size="2"
maxlength="2" value=""
onkeyup="changeCursor(document.frmIncident.txtEDay,document.frmIncident.txtEMonth,
2)" ID="Text1">/
</td>
<td width=20%>
<input style="border: thin inset;" type="text" name="txtEMonth"
size="2" maxlength="2" value=""
onkeyup="changeCursor(document.frmIncident.txtEMonth,document.frmIncident.txtEYear
,2)" ID="Text2">/
</td>
<td width=40%>
<input style="border: thin inset;" type="text" name="txtEYear" size="4"
maxlength="4" value="" ID="Text3">
</td>
</td>
the java movecursor stuff:
function changeCursor(from,to,len)
{
if(from.value.length >= len)
{
to.focus();
}
return true;
}
the java validation is as follows:
function DoSubmit(PostType)
{
var txteday = ""
var txtemonth = ""
var txteyear = ""
var newdate = ""
if (frmIncident.txtEDay.value == "")
{
alert("Incomplete Episode date entered, Please enter a Episode date");
return;
}
else if (frmIncident.txtEMonth.value == "")
{
alert("Incomplete Episode date entered, Please enter a Episode date");
return;
}
else if (frmIncident.txtEYear.value == "")
{
alert("Incomplete Episode date entered, Please enter a Episode date");
return;
}
else
{
txteday = frmIncident.txtEDay.value + '/'
txtemonth = frmIncident.txtEMonth.value + '/'
txteyear = frmIncident.txtEYear.value
newdate = txteday + txtemonth + txteyear
if (!IsDate(newdate))
{
frmIncident.txtEDay.focus();
return;
}
frmIncident.txtEdate.value = newdate;
frmIncident.PostType.value = PostType;
frmIncident.action = "Incident_Report_New.asp";
frmIncident.submit();
}
}
then asp retrieves ans sends on its way !
thanks again
>
>
*
*
*
This message, including any attachments, is intended solely for the use of the named recipient(s) and may contain confidential and/or priveleged information. Any unauthorized review, use, disclosure or distribution of this communication(s) is expressly prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy any and all copies of the original message.
More information about the thelist
mailing list