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:50 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default problem with submiting and checkboxes

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
  #2 (permalink)  
Old October 30th, 2006, 02:26 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Viewstate was not introduced until .NET thus it is not available in Classic ASP; since you are using javascript to facilitate this, you will have to adjust your javascript to not uncheck the boxes that have been previously checked.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
Reply With Quote
  #3 (permalink)  
Old October 30th, 2006, 02:30 PM
Authorized User
 
Join Date: Feb 2006
Location: , , .
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there a code for this?

Reply With Quote
  #4 (permalink)  
Old October 30th, 2006, 02:39 PM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Yes; google for references to document.form.element.checked

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
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 checkboxes with submittion Paula222 Classic ASP Basics 0 October 30th, 2006 12:42 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 03:16 AM.


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