Monday, 30 March 2009

Making a Check Out Page

Firstly, I make page called "checkOut.asp"

In Code View,I type some pieces of code before ""
TAG.
<% ' THIS BIT DEFINES THE CONSTANTS USED IN OUR SCRIPT

CONST CARTPID = 0
CONST CARTPNAME = 1
CONST CARTPPRICE = 2
CONST CARTPQUANTITY = 3

' THIS BIT GETS THE SHOPPING CART SESSION VARIABLE

IF NOT isArray( Session( "cart" ) ) THEN
DIM localCart( 4, 20 )
ELSE
localCart = Session( "cart" )
END IF

%>



Then, I switch to Design View in order to make simple form containing
Delivery Detail and product details that Customer has added to cart.

Naming
the form as "myform". Set "Action" as "shop_ccard.asp" and the "Method" as "POST".



In the form, I create some textfields and give them their name respectively.

name's textfield as name
address's textfield as address
city's textfield as city
postcode 's textfield as postcode
country's textfield as country
phone's textfield as phone
email's textfield as email

Next step is to insert a button called "next", it will be replaced by image so all the form will be looked like



the form is OK for this moment. I move to next step which is to implement ASP code so that the check out page work nicely.

First of all, I insert 2 hidden textfield














Now, I am going to FORM VALIDATION by Dreamweaver

Firstly, I go to "
Tag Inspector", switch to "Behavior" tab and then drop down a menu list.



I am going to choose
validation form as above then a small window will pop up:



For each line in "
FIELD" box, I tick "required" with "Accept" option matching.

Then at testing stage. I have got:



A error in this page is, a error message does not pop up when I click on Next button, and all fields are left blank.

so I post my query on different Forums to get a solution:

My post is on
ASPFREE.COM



Ecommerce forum



After a day, I have got a reply from ASPFREE



From the solutions above, I switch back to my code view and fix it.



My result comes up successfully

No comments:

Post a Comment