<% @LANGUAGE="JScript"
%>
<HTML>
<HEAD>
<!--#include file="checkoutvalidate.inc"-->
</HEAD>
<BODY>
<CENTER>
<FORM METHOD=POST ACTION="checkoutcredit.asp"
onSubmit="return
checkCompleted(this)">
|
align="left">The
remainder of the page consists of the form elements contained within a table
for formatting. At the top is a group of radio buttons for selecting the
customer's title. When the form is submitted only the value of the radio
button that has been selected by the user will be sent.
align="left">The
remainder of the form consists of input boxes, each of which has its maxlength
property set to match the maximum size of the relevant database field which
acts as a basic form of validation. At least we know the user has not entered
a string value length greater than we can store. The problem comes if we
change the size of the database fields, as we must remember to update the
page. This problem could be overcome by building the page dynamically using
ASP script. Using ADO we could obtain the correct sizes of each field and
populate the maxlengths
on the basis of this information. This would increase maintainability but at
the expense of scalability as server processing load would be increased
significantly. Here I have gone for scalability by having static values.
align="left"> The
last input element in the form is a text box for the customer's country. It
would help ensure valid data if we changed this to a select element with a
drop down list of countries rather than a text box. For this example I kept it
as a text box to save typing a long list of countries!
<FONT FACE="Comic Sans MS"
SIZE="3" color="Navy">
Please enter your NAME, address and
e-mail address below.<BR>
</FONT>
<TABLE>
<TR>
<TD><FONT FACE="Comic
Sans MS" SIZE="2">Title</FONT></TD>
<TD>
<FONT
FACE="Comic Sans MS" SIZE="2">
Mr<INPUT
NAME="radTitle" TYPE="radio" VALUE="Mr">
Mrs<INPUT
NAME="radTitle" TYPE="radio" VALUE="Mrs">
Miss<INPUT
NAME="radTitle" TYPE="radio"
VALUE="Miss">
Ms.<INPUT
NAME="radTitle" TYPE="radio"
VALUE="Ms.">
Dr.<INPUT
NAME="radTitle" TYPE="radio"
VALUE="Dr.">
</FONT>
</TD>
</TR>
<TR>
<TD><FONT FACE="Comic
Sans MS" SIZE="2">First Name</FONT>
<TD><INPUT
TYPE="Text" NAME="txtFirstName" maxlength="50">
</TR>
<TR>
<TD><FONT FACE="Comic
Sans MS" SIZE="2">Last Name</FONT>
<TD><INPUT
TYPE="Text" NAME="txtLastName" maxlength="50">
</TR>
<TR>
<TD><FONT FACE="Comic
Sans MS" SIZE="2">E-mail Address</FONT>
<TD><INPUT
TYPE="Text" NAME="txtEmail" maxlength="75">
</TR>
<TR>
<TD><FONT FACE="Comic
Sans MS" SIZE="2">Street</FONT>
<TD><INPUT
TYPE="Text" NAME="txtStreet" maxlength="75">
</TR>
<TR>
<TD><FONT FACE="Comic Sans MS"
SIZE="2">City</FONT>
<TD><INPUT
TYPE="Text" NAME="txtCity" maxlength="50">
</TR>
<TR>
<TD><FONT FACE="Comic
Sans MS" SIZE="2">County/State</FONT>
<TD><INPUT
TYPE="Text" NAME="txtLocality" maxlength="50">
</TR>
<TR>
<TD><FONT FACE="Comic
Sans MS" SIZE="2">Post/Zip Code</FONT>
<TD><INPUT
TYPE="Text" NAME="txtPostCode" maxlength="15">
</TR>
<TR>
<TD><FONT FACE="Comic
Sans MS" SIZE="2">Country</FONT>
<TD><INPUT
TYPE="Text" NAME="txtCountry" maxlength="50">
</TR>
<TR>
<TD COLSPAN=2>
<INPUT
TYPE="reset" NAME="cmdReset" VALUE="Clear
form">
<INPUT
TYPE="button" NAME="cmdPrevious"
VALUE=" Back "
onClick="window.location.href='checkoutframe.php'">
<INPUT
TYPE="submit" NAME="cmdSubmit"
VALUE="Continue">
</TD>
</TR>
</TABLE>
</FORM>
</CENTER>
</BODY>
</HTML>
|
Save
the page as PersonalDetails.asp
The final
page, as far as inputting user details is concerned, is CheckoutCredit.asp
which gets that all important information we need to get our hands on the
user's money!