Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<% If Request.QueryString("action") = "verify" then
Dim ChkValue, tmpChkValue, ChkCount
tmpChkValue = Request.Form("check")
ChkValue = Replace(tmpChkValue, ", ", ",") '# take out spaces
ChkValue = Split(ChkValue, ",")
For Each Check in ChkValue
ChkCount = ChkCount + 1 '# Count checked boxes...
Next
If ChkCount > 3 Then
Response.Write "You checked more then 3 boxes please fix it and try again!"
Else
Response.Write "Ok the right number of checkboxes are checked, here is where we add the response.Redirect to your page2.asp page"
End If
End if
%>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="page1.asp?action=verify">
<input type="checkbox" name="check" value="1" <% If InStr(Request.Form("check"), "1") > 0 then Response.Write "checked" %>>
<input type="checkbox" name="check" value="2" <% If InStr(Request.Form("check"), "2") > 0 then Response.Write "checked" %>>
<input type="checkbox" name="check" value="3" <% If InStr(Request.Form("check"), "3") > 0 then Response.Write "checked" %>>
<input type="checkbox" name="check" value="4" <% If InStr(Request.Form("check"), "4") > 0 then Response.Write "checked" %>>
<input type="checkbox" name="check" value="5" <% If InStr(Request.Form("check"), "5") > 0 then Response.Write "checked" %>>
<input type="checkbox" name="check" value="6" <% If InStr(Request.Form("check"), "6") > 0 then Response.Write "checked" %>>
<input type="submit" name="Submit" value="Submit">
</form>
[/b]
After you do that goto the page on your server
[URL unfurl="true"]http://localhost/page1.asp[/URL]
This code works, but for some reason you are not doing something right. You will get it, hang in there.
-Jason
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<a href="page1.asp">QueryString Verify method</a><br>
<a href="check.asp">2 page verifying method</a><br>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="check2.asp">
<input type="checkbox" name="check" value="1|flower1" <% If InStr(Session("chkvalue"), "1") > 0 then Response.Write "checked" %>>
<input type="checkbox" name="check" value="2|flower2" <% If InStr(Session("chkvalue"), "2") > 0 then Response.Write "checked" %>>
<input type="checkbox" name="check" value="3|flower3" <% If InStr(Session("chkvalue"), "3") > 0 then Response.Write "checked" %>>
<input type="checkbox" name="check" value="4|flower4" <% If InStr(Session("chkvalue"), "4") > 0 then Response.Write "checked" %>>
<input type="checkbox" name="check" value="5|flower5" <% If InStr(Session("chkvalue"), "5") > 0 then Response.Write "checked" %>>
<input type="checkbox" name="check" value="6|flower6" <% If InStr(Session("chkvalue"), "6") > 0 then Response.Write "checked" %>>
<input type="submit" name="Submit" value="Submit">
</form>
</body>
</html>
<%
Dim ChkValue, tmpChkValue, ChkCount, SplitChkValue, AryItems(6), ItemsChecked
tmpChkValue = Request.Form("check")
Session("chkvalue") = tmpChkValue
ChkValue = Replace(tmpChkValue, ", ", ",") '# take out spaces
ChkValue = Split(ChkValue, ",")
AryItems(1) = "flower1"
AryItems(2) = "flower2"
AryItems(3) = "flower3"
AryItems(4) = "flower4"
AryItems(5) = "flower5"
AryItems(6) = "flower6"
For Each Check in ChkValue
chkcount = chkcount + 1 '# count chks
If instr(tmpChkValue,AryItems(chkcount)) > 1 then '# If the word flowerX appears in the form values add to list
ItemsChecked = ItemsChecked & ", " & AryItems(chkcount)
End if
Next
If Left(ItemsChecked, 1) = "," then
ItemsChecked = Right(ItemsChecked, Len(ItemsChecked) - 1) '# Remove the very left comma
End if
If ChkCount > 3 Then
Response.Write "You chose " & ItemsChecked & " <b>you have selected to many checks</b> please go back and select less then 3 checkboxes"
Else
Response.write "You have checked " & ItemsChecked & " you may proceed!"
End If
%>
<a href="check.asp">go back</a>