Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Submit Button

Status
Not open for further replies.

nikdiva

Programmer
Jul 27, 2001
17
US
Hi,
I am trying to create a series of pages that allow the user to filter data by passing selections to session variables. The first page has checkboxes that return codes. When I test the submit button it is not going to the next page...here is the code

Code:
</head>
<body>
    <form action="storetype.aspx" method="post" runat="server">
        <center>
            <h1>Select the Region 
            </h1>
        </center>
        <table style="WIDTH: 253px; HEIGHT: 460px" align="center" border="1">
            <tbody>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkAtlanta" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Atlanta" Font-Bold="True"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkBaltimore" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Baltimore" Font-Bold="True"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkBoston" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Boston" Font-Bold="True"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkChicago" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Chicago" Font-Bold="True"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkCleveland" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Cleveland" Font-Bold="True"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkDallas" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Dallas" Font-Bold="True"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkLA" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Los Angeles" Font-Bold="True"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkNY" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="New York" Font-Bold="True"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkPhiladelphia" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Philadelphia" Font-Bold="True"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkSF" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="San Francisco" Font-Bold="True"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkDC" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Washington D.C." Font-Bold="True" Width="177px"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkMiami" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Miami" Font-Bold="True" Width="177px"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkDetroit" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Detroit" Font-Bold="True" Width="177px"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkPhoenix" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Phoenix" Font-Bold="True" Width="177px"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="4">
                        <asp:CheckBox id="ChkHouston" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Houston" Font-Bold="True" Width="177px"></asp:CheckBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <div align="left">
                            <asp:CheckBox id="ChkMinneapolis" runat="server" Font-Size="X-Small" Font-Names="Courier New" Text="Minneapolis" Font-Bold="True" Width="107px"></asp:CheckBox>
                        </div>
                    </td>
                    <td>
                        <div align="right">
                            <asp:TextBox id="txtCount" runat="server" Width="65px"></asp:TextBox>
                        </div>
                    </td>
                </tr>
                <tr>
                </tr>
                <tr>
                    <td colspan="2">
                        <div align="left">
                            <div align="center">
                                <asp:Button id="btnAll" onclick="btnAll_Click" runat="server" Text="Select All"></asp:Button>
                            </div>
                        </div>
                    </td>
                    <td>
                        <div align="left">
                            <div align="center">
                                <asp:Button id="btnClear" onclick="btnClear_Click" runat="server" Text="Clear"></asp:Button>
                            </div>
                        </div>
                    </td>
                    <td>
                        <div align="left">
                            <div align="center">
                                <div align="center">
                                    <asp:Button id="btnSubmit" onclick="btnSubmit_Click" runat="server" Text="Submit"></asp:Button>
                                </div>
                            </div>
                        </div>
                    </td>
                </tr>
                <tr>
                </tr>
            </tbody>
        </table>
        <div align="center">
            <asp:RangeValidator id="RangeValidator1" runat="server" Type="Integer" MinimumValue="1" MaximumValue="16" ControlToValidate="TxtCount" ErrorMessage="Please Make at Least 1 Selection!"></asp:RangeValidator>
        </div>


---------------------------------------------------------
 Sub btnSubmit_Click(s As Object, e As EventArgs)
    
    Dim CountChecked as Integer
    
    CountChecked = 0
    
    If chkAtlanta.Checked = True then
     Session("RegionFilter") = "01"
     CountChecked = CountChecked + 1
    End If
    
    If chkBaltimore.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '02'"
       Else
           Session("RegionFilter") = "02"
           CountChecked = CountChecked + 1
       End If
    End If
    
    If chkBoston.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '03'"
       Else
           Session("RegionFilter") = "03"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkChicago.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '04'"
       Else
           Session("RegionFilter") = "04"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkCleveland.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '05'"
       Else
           Session("RegionFilter") = "05"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkDallas.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '06'"
       Else
           Session("RegionFilter") = "06"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkLA.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '08'"
       Else
           Session("RegionFilter") = "08"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkNY.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '09'"
       Else
           Session("RegionFilter") = "09"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkPhiladelphia.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '10' or '16'"
       Else
           Session("RegionFilter") = "'10' or '16'"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkSF.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '11'"
       Else
           Session("RegionFilter") = "11"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkDC.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '13'"
       Else
           Session("RegionFilter") = "13"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkMiami.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '14'"
       Else
           Session("RegionFilter") = "14"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkDetroit.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '15'"
       Else
           Session("RegionFilter") = "15"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkPhoenix.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '17'"
       Else
           Session("RegionFilter") = "17"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    If chkHouston.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '18'"
       Else
           Session("RegionFilter") = "18"
           CountChecked = CountChecked + 1
       End If
    End If
    
    If chkMinneapolis.Checked = True then
       If CountChecked >= 1
           Session("RegionFilter") &= " or '19'"
       Else
           Session("RegionFilter") = "19"
           CountChecked = CountChecked + 1
       End If
    End If
    
    
    txtCount.Text = CountChecked


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top