ASP 101 News Flash |
 |
|
|
Sample HTML Code generated by the ASP:
I'm sorry but your form wasn't filled out correctly.
Please correct the fields indicated by the check marks.
<FORM ACTION="/samples/form_handler.asp" METHOD="post" NAME="TheForm">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<TR>
<TD ALIGN="right"><B>Name:</B> </TD>
<TD><INPUT NAME="Name" TYPE="text" VALUE="John"></INPUT></TD>
<TD></TD>
</TR>
<TR>
<TD ALIGN="right"><B>Email:</B> </TD>
<TD><INPUT NAME="Email" TYPE="text" VALUE="john@some_domaincom"></INPUT></TD>
<TD><IMG SRC="../images/check.gif" BORDER="0" WIDTH="25" HEIGHT="25"></TD>
</TR>
<TR>
<TD ALIGN="right"><B>Address:</B> </TD>
<TD><INPUT NAME="Address" TYPE="text" VALUE="123 Main Street"></INPUT></TD>
<TD></TD>
</TR>
<TR>
<TD ALIGN="right"><B>City:</B> </TD>
<TD><INPUT NAME="City" TYPE="text" VALUE="Any Town"></INPUT></TD>
<TD></TD>
</TR>
<TR>
<TD ALIGN="right"><B>State:</B> </TD>
<TD><INPUT NAME="State" TYPE="text" VALUE="New York"></INPUT></TD>
<TD><IMG SRC="../images/check.gif" BORDER="0" WIDTH="25" HEIGHT="25"></TD>
</TR>
<TR>
<TD ALIGN="right"><B>Zip:</B> </TD>
<TD><INPUT NAME="Zip" TYPE="text" VALUE="1111"></INPUT></TD>
<TD><IMG SRC="../images/check.gif" BORDER="0" WIDTH="25" HEIGHT="25"></TD>
</TR>
</TABLE>
<INPUT TYPE="reset" VALUE="Reset The Form"></INPUT>
<INPUT TYPE="submit" VALUE="Submit The Form"></INPUT><BR>
<BR>
<INPUT TYPE="button" VALUE="Enter Invalid Data!" OnClick="return FillInTheFormBad()"></INPUT>
<INPUT TYPE="button" VALUE="Enter Valid Data!" OnClick="return FillInTheFormGood()"></INPUT><BR>
</FORM>
<SCRIPT LANGUAGE="Javascript">
<!--
//Us doing client-side script! Did you ever thing you'd see the day?
//Enter Bad Data Into the Form
function FillInTheFormBad() {
document.TheForm.Name.value = "John";
document.TheForm.Email.value = "john@some_domaincom";
document.TheForm.Address.value = "123 Main Street";
document.TheForm.City.value = "Any Town";
document.TheForm.State.value = "New York";
document.TheForm.Zip.value = "1111";
}
//Enter Good Data Into the Form
function FillInTheFormGood() {
document.TheForm.Name.value = "John";
document.TheForm.Email.value = "john@some_domain.com";
document.TheForm.Address.value = "123 Main Street";
document.TheForm.City.value = "Any Town";
document.TheForm.State.value = "NY";
document.TheForm.Zip.value = "11111";
}
//-->
</SCRIPT>

|
|