Some programs we downloaded online such as forums have installed wizards like software during installation. This facilitates the installation of users. How can this feature be realized?
The main problem we face is:
1. The interface is exactly the same as a Windows Wizard.
2. Users can use the BACK button to return to any previous step, and can change the content that has been selected in any previous step
3. Form must remember all the contents that are filled in
4. Can't use the database
5. Can't use sessions to prevent all the inputs of the user lost after the sessiosn fails. Unfortunately, Cookie cannot be used
Because many Cookie options that often turn off their browsers.
6. The portability is better because it adapts to the situation when the installation steps are different
Solution:
1. Use HIDDEN variable to pass parameters
2. Using the POST method, do not use the GET method, because this method is limited by length
3. Each page must have a function to read the submitted value
4. Each page (except the first page) must have a HIDDEN form to pass the parameter to the front page
If you use Checkboxes or Radio Buttons on your page, please use the following code read value:
<% For Each item in request.form
If request.form (item) .count then
For intLoop = 1 to request.form (item) .count
Response.write item = & item & index = & Intloop & <br>
Next
Else
Response.write item = & item & <br>
End if
Next
%>
The design is to use a special processing method for Checkboxes and Radio:
1. Only the latest value is considered to be saved in these two methods
2. Users can use BACK to change the value entered before, but they must be submitted with Next to take effect
3. The page must be able to cope with the situation where there are multiple Controls on one page
Specific implementation method:
The n page should have:
1. The first form: its action = page (n+1) .asp and its bottom must have the NEXT button
2. Second Form: its action = page (n-) .asp and back buttons
3. Variable naming rules: Example: n_ <page no> suffix is control type. <Input type = radio name = radio_p2>
It means that a name of the second page is Radio
4. A function used to read submission
The page determines which page of the current control is based on a cycle.
The code is as follows:
< %@Language = VBScript %>
<Html>
<Head>
</Head>
<body>
<!-NEXT button module programming starts->
<FORM ACTION = PAGE03.asp Method = Post>
<! ------------------------------------------------------------------------------------------------------------------------------------------------- -------------->>
<!-Read the function to start->
<! ------------------------------------------------------------------------------------------------------------------------------------------------- -------------->>
<%
pageno = _p2
For Each item in request.Form
WhichPage = Instr (1, CSTR (Item), Pageno, 1)
Ifst.form (item) .count) and (whitepage = 0) then
strcount = request.form (item) .count
stritem = request.form (item) (strcount)
Response.write <input type = hidden name = & item & value = & stritem &> & vBCRLF
Elseif (not (request.form (it) .count) and (whitepage = 0) then
Response.write <input type = hidden name = & item & value = & stritem &> & vBCRLF
End if
Next
%>
<! ------------------------------------------------------------------------------------------------------------------------------------------------- ------------->>
<1-- Read the function of the function->
<! ------------------------------------------------------------------------------------------------------------------------------------------------- ------------->>
<!-#include file = check_uncheck.txt->
<%
Function Check_uncheck (CtrlName, Ctrlvalue)
Dim ctrlname_in
Dim ctrlvalue_in
Dim ctrlvalue_actual
Dim outstr
ctrlvalue_in =
ctrlName_in =
ctrlvalue_actual =
OUTSTR =
ctrlname_in = ctrlname_in & ctrlname
ctrlvalue_in = ctrlvalue_in & ctrlvalue
If request.form (ctrlname_in) .count then
strcount = request.form (ctrlname_in) .count
ctrlvalue_actual = request.form (ctrlname_in) (strcount)
If ctrlvalue_actual = ctrlvalue_in then
outstr = checked
End if
Else
ctrlvalue_actual = request.form (ctrlname_in)
If ctrlvalue_actual = ctrlvalue_in then
outstr = checked
End if
End if
Check_unches = outstr
End function
%>
<!-BACK button module starts->
<%
stritem1 =
stritem1a =
For Each item1 in request.Form
If request.form (item1) .count then
strcount1 = request.form (item1) .count
stritem1 = requesest.form (item1) (strcount1)
Response.write <input type = hidden name = & item1 & value = & stritem1 &> & vBCRLF
strcount1 =
stritem1 =
Else
stritem1a = request.form (item1)
Response.write <input type = hidden name = & item1 & value = & stritem1a &> & vBCRLF
End if
Next
stritem1 =
stritem1a =
%>