Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 30th, 2006, 12:42 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with checkboxes with submittion

Hi ,
i created 7 combo boxed - each of them should become checked and disabled on 'onclick' event. When i choose first checkbox it works fine , but each of the next clicks erases the last choice , so in each click i can see only one disabled selected checkbox - But i need it to remember all the choices . when i worked with Asp.NET there was a thing called 'ViewState' - and this is what i need here , but i can't make it work . Here is the code i used :

do while not mainRs.EOF

                           if (mainRs(30) <> "" and mainRs(29) <> "") then
                           if (( ( day(Date())<day(mainRs(29)) and month(Date())<=month(mainRs(29)) ) or ( (day(Date()) >= day(mainRs(29)) ) and ( month(Date()) < month(mainRs(29)) ) ) ) or ( ((day(Date()) = day(mainRs(29)))and(month(Date()) = month(mainRs(29))))and((hour(Time())<hour(mainRs(3 0)))or((hour(Time()) = hour(mainRs(30)))and(minute(Time()) < minute(mainRs(30))))) ) ) then
                            firstTypeCounter = firstTypeCounter + 1
                            %>
                      <form id="frm<%=firstTypeCounter%>" method="post" action="game.asp?CatID=<%Response.Write(Request.Qu eryString("CatID"))%>&GameID=<%Response.Write(Requ est.QueryString("GameID"))%>&lang=<%Response.Write (Request.QueryString("lang"))%>">
                              <tr bgcolor="FCFAFA">

                                <td width="57" class="tdlineviewtablecellside211" dir="ltr"><% Response.Write(mainRs(29)) %></td>
                                <td width="3"><img height="1" src="../images/1x1.gif" width="1"></td>
                                <td width="66" class="tdlineviewtablecellside212" dir="ltr"><% Response.Write(mainRs(3+lang)) %></td>
                                <td colspan="2" class="tdlineviewtablecellside212">
                                <%
                                   if(((cint(Minute(mainRs(30))) - cint(Minute(Time())) <= 10) ) and (cint(Hour(mainRs(30))) = cint(Hour(Time()))) and (cint(Day(Date())) = cint(Day(mainRs(29)))) and (cint(Month(Date())) = cint(Month(mainRs(29)))) ) then
                                %>
                                <img src="images/bullet.gif" width="10" height="10">
                                <%
                                   end if
                                %>
                                </td>
                                <td width="36" align="left" class="tdlineviewtablecellside212"><div align="center">
                                <%
                                if (mainRs(7) <> "") then
                                %>
                                <%
                                  ' Response.Write("<script language='JavaScript'>alert('" & "checkbox" & Request.QueryString("CatID") & Request.QueryString("GameID") & mainRs(2) & "---" & Request.Form("checkbox" & Request.QueryString("CatID") & Request.QueryString("GameID") & mainRs(2)) & "');</script>")
                                %>
                                <input type="checkbox" name="checkbox<%=Request.QueryString("CatID")%><%= Request.QueryString("GameID")%><%=mainRs(2)%>1" value="1" onclick="SubmitForm('frm<%=firstTypeCounter%>');" <%if(Request.Form("checkbox" & Request.QueryString("CatID") & Request.QueryString("GameID") & mainRs(2) & "1")="1") then Response.Write("checked disabled") end if%>><input type="hidden" name="chkTypeID" value="1"><input type="hidden" name="chkGambleID" value="<%=mainRs(2)%>">
                                <%
                                end if
                                %>


                                </div></td>
                                <td width="54" class="tdlineviewtablecellside211" dir="ltr">
                                <%
                                      if(isUS = "US") then
                                      if (mainRs(7) <> "") then
                                         if (cdbl(mainRs(7)) >= 2) then
                                            Response.Write(cint(((cdbl(mainRs(7)))-1)*100))
                                         elseif (cdbl(mainRs(7)) < 2 and cdbl(mainRs(7)) > 1) then
                                            Response.Write(cint((-100/((cdbl(mainRs(7)))-1))))
                                         end if
                                          else
                                          Response.Write(mainRs(7))
                                         end if
                                      else
                                         Response.Write(mainRs(7))
                                      end if
                                %>
                                </td>
                                <td width="6"><img height="1" src="/10BetClient/images/1x1.gif" width="1"></td>
                                <td width="10" class="tdlineviewtablecellside212">
                                <% if (((cint(Minute(mainRs(30))) - cint(Minute(Time())) <= 10) ) and (cint(Hour(mainRs(30))) = cint(Hour(Time()))) and (cint(Day(Date())) = cint(Day(mainRs(29)))) and (cint(Month(Date())) = cint(Month(mainRs(29))) )) then %>
                                <img src="images/bullet.gif" width="10" height="10">
                                <% end if %>
                                </td>
                                <td width="36" align="left" class="tdlineviewtablecellside212"><div align="center">
                                <%
                                   if(mainRs(8) <> "") then
                                %>
                                <%'Response.Write("<script language='JavaScript'>alert('" & firstTypeCounter & "');</script>")%>
                                <input type="checkbox" name="checkbox<%=Request.QueryString("CatID")%><%= Request.QueryString("GameID")%><%=mainRs(2)%>2" value="1" onclick="SubmitForm('frm<%=firstTypeCounter%>');" <%if (Request.Form("checkbox" & Request.QueryString("CatID") & Request.QueryString("GameID") & mainRs(2) & "2" ) <> "") then Response.Write("checked disabled") end if%>><input type="hidden" name="chkTypeID" value="2"><input type="hidden" name="chkGambleID" value="<%=mainRs(2)%>">
                                <%
                                  end if
                                %>

                                </div></td>
                                <td width="42" dir="ltr" class="tdlineviewtablecellside211"><% Response.Write(mainRs(15)) %></td>
                                <td width="54" class="tdlineviewtablecellside211" dir="ltr">
                                <%
                                      if(isUS = "US") then
                                      if (mainRs(8) <> "") then
                                         if (cdbl(mainRs(8)) >= 2) then
                                            Response.Write(cint(((cdbl(mainRs(8)))-1)*100))
                                         elseif (cdbl(mainRs(8)) < 2 and cdbl(mainRs(8)) > 1) then
                                            Response.Write(cint((-100/((cdbl(mainRs(8)))-1))))
                                         end if
                                          else
                                          Response.Write(mainRs(8))
                                         end if
                                      else
                                         Response.Write(mainRs(8))
                                      end if
                                %>
                                </td>
                                <td width="6"><img height="1" src="/10BetClient/images/1x1.gif" width="1"></td>
                                <td width="10" class="tdlineviewtablecellside212">
                                <%
                                 if (((cint(Minute(mainRs(30))) - cint(Minute(Time())) <= 10) ) and (cint(Hour(mainRs(30))) = cint(Hour(Time()))) and (cint(Day(Date())) = cint(Day(mainRs(29)))) and (cint(Month(Date())) = cint(Month(mainRs(29))) )) then
                                %>
                                <img src="images/bullet.gif" width="10" height="10">
                                <%
                                  end if
                                %>
                                </td>
                                <td width="36" align="left" class="tdlineviewtablecellside212"><div align="center">
                                <%
                                   if (mainRs(9) <> "") then
                                %>
                                <input type="checkbox" name="checkbox<%=Request.QueryString("CatID")%><%= Request.QueryString("GameID")%><%=mainRs(2)%>3" value="1" onclick="SubmitForm('frm<%=firstTypeCounter%>');" <% if (Request.Form("checkbox" & Request.QueryString("CatID") & Request.QueryString("GameID") & mainRs(2) & "3") = "1") then Response.Write("checked disabled") end if%>><input type="hidden" name="chkTypeID" value="3"><input type="hidden" name="chkGambleID" value="<%=mainRs(2)%>">

                                <%
                                   end if
                                %>
........

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with submiting and checkboxes Paula222 Classic ASP Basics 3 October 30th, 2006 02:39 PM
ASPUpload component submittion issue tarzannn Classic ASP Components 0 October 3rd, 2006 11:04 PM
problem with foreach loop in Checkboxes datagrid mbge9pjb .NET Framework 2.0 2 December 20th, 2005 10:03 AM
Problem Pre Selecting CheckBoxes in a CheckBoxLis sandersbr ASP.NET 1.0 and 1.1 Basics 2 August 13th, 2004 08:14 AM



All times are GMT -4. The time now is 12:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.