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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple groups of check boxes

Status
Not open for further replies.

jonohara

Technical User
Mar 26, 2000
53
GB
Hi

I've a contact page/form which generates THREE groups of check boxes.

Each check box has a unique 'value' and is 'named' one of the three group names (products, services, applications).

I'm using cdonts to email the results. I can only manage to extract the check box values from the first group of checkboxes (products) but not the others, even though my code is the same for all.

A sample of the code is bellow. I'm sure that the names are ok.
Code:
strbody = strbody &  "<td width=""190"">Products</td>"
strbody = strbody &  "<td width=""71%"">" & request.form("products") & "</td>"

strbody = strbody & "</td>"
strbody = strbody &  "</tr>"
strbody = strbody & "<tr>"
strbody = strbody &  "<td width=""190"">Industry Areas</td>"
strbody = strbody &  "<td width=""71%"">" & request.form("applications") & "</td>"

strbody = strbody & "</td>"

Any ideas?

Thanks
 
Suggest replacing the quotes surrounding parameter values with apostrophes, eg :

Code:
strbody = strbody & "</td>"
strbody = strbody &  "</tr>"
strbody = strbody & "<tr>"
strbody = strbody &  "<td width='190'>Industry Areas</td>"
strbody = strbody &  "<td width='71%'>" & request.form("applications") & "</td>"

Other than that, I'd need to see more of your source code to comment further.
 
can you post the code with the <INPUT TYPE="CHECKBOX"> bits in please

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Thanks

As you will see the check box values are generated from a db.
Code:
        <% 
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) 
%>
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite"><%=(Recordset1.Fields.Item("menulabel2").Value)%></td>
                  <td width="5%"><input type="checkbox" name="Products" value="<%=(Recordset1.Fields.Item("menulabel2").Value)%>"></td> 
                </tr>
                <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Recordset1.MoveNext()
Wend
%>
              </table></td>
            <td valign="top"><table width="100%" border="0">
                <tr> 
                  <td width="95%" class="titleonwhite">Industry Areas</td>
                  <td width="5%">&nbsp;</td>
                </tr>
                <% 
While ((Repeat2__numRows <> 0) AND (NOT Recordset2.EOF)) 
%>
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite"><%=(Recordset2.Fields.Item("menulabel2").Value)%></td>
                  <td width="5%"> 
                    <input type="checkbox" name="industry" value="<%=(Recordset2.Fields.Item("menulabel2").Value)%>"></td> 
                </tr>
                <% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  Recordset2.MoveNext()
Wend
%>
 
Sorry, The actual code uses 'industry' in both, I changed it it my first post to make it clearer (obviously failed there then!).

Thanks
 
Please could you post the HTML code (not the ASP) of the FORM page. Do a View >> Source and post the relevant bits with all the <INPUT TYPE="CHECKBOX"...> bits.

Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
the form code is :

Code:
<form action="cdonts/contact3.asp" method="post" name="mailform" onSubmit="MM_validateForm('name','','R','email','','RisEmail');return document.MM_returnValue">
        <table width="100%" border="0" bordercolor="#CCCCCC">
          <tr> 
            <td width="25%" class="titleonwhite">Contact Details</td>
            <td>Your Unique Enquiry Ref is 84489</td>
            <td>
<input name="enqid" type="hidden" id="enqid" value="Response.Write strTemp"></td>
            <td>&nbsp;</td>
          </tr>
          <tr bordercolor="#CCCCCC" class="textonwhite"> 
            <td width="25%" bgcolor="#CCCCCC">Contact Name</td>
            <td bgcolor="#CCCCCC"><input name="name" type="text" class="required" id="name">
              *</td>
            <td bgcolor="#CCCCCC">Company Name</td>
            <td bgcolor="#CCCCCC"><input name="company" type="text" id="company" value=""></td>
          </tr>
          <tr bordercolor="#CCCCCC" class="textonwhite"> 
            <td bgcolor="#CCCCCC">Email Address</td>
            <td bgcolor="#CCCCCC"><input name="email" type="text" class="required" id="email">
              *</td>
            <td bgcolor="#CCCCCC">Telephone Number</td>
            <td bgcolor="#CCCCCC"><input name="telephone no" type="text" id="telephone no"></td>
          </tr>
          <tr bordercolor="#CCCCCC" class="textonwhite"> 
            <td bgcolor="#CCCCCC">Postcode/Zip</td>
            <td bgcolor="#CCCCCC"><input name="postcode" type="text" id="postcode" value=""></td>
            <td bgcolor="#CCCCCC">Address</td>
            <td bgcolor="#CCCCCC"><textarea name="address" id="address"></textarea></td>
          </tr>
          <tr bgcolor="#CCCCCC" class="textonwhite"> 
            <td>Additional Information</td>
            <td><textarea name="information" id="information"></textarea></td>
            <td colspan="2" valign="top" bordercolor="#CCCCCC" bgcolor="#FFFFFF"><p>If 
                you are interested in specific products or services then please 
                indicate which on the form below before submitting your details. 
                If you do not receive an enquiry reciept confirmation, please 
                email <a href="mailto:jwatson@delkor.co.uk">John Watson</a> or 
                call<br>
                <strong>+44(0) 1761-417079</strong>.<br>
                <br>
                * indicates required field.</p>
              <p align="right"> 
                <input name="Submit" type="submit" onClick="MM_validateForm('name','','R','email','','RisEmail');return document.MM_returnValue" value="Submit Form">
                <input type="reset" name="Submit2" value="Clear Form">
              </p></td>
          </tr>
        </table>
        <table width="100%" border="0">
          <tr> 
            <td valign="top"><table width="100%" border="0">
                <tr> 
                  <td width="95%" class="titleonwhite">Products
                    <input name="hiddenField" type="hidden" value="Products/Services Selected..."></td>
                  <td width="5%">&nbsp;</td>
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Bond Filters</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Bond Filters"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Filter Presses</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Filter Presses"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Hi-Rate & Conventional Thickeners</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Hi-Rate & Conventional Thickeners"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Spiral Separators</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Spiral Separators"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Tipping Pan Filters</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Tipping Pan Filters"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Horizontal Belt Filters</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Horizontal Belt Filters"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Ultra Hi-Rate & Paste Thickeners</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Ultra Hi-Rate & Paste Thickeners"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Linear Screens</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Linear Screens"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Fournier Rotary Presses</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Fournier Rotary Presses"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Mixers & Agitators</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Mixers & Agitators"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Pump Cells</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Pump Cells"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Electrowinning Cells</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Electrowinning Cells"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Carbon Kilns</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Carbon Kilns"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Vortex Ring Mixers</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Vortex Ring Mixers"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Flotation Cells</td>
                  <td width="5%"><input type="checkbox" name="Products" value="Flotation Cells"></td> 
                </tr>
                
              </table></td>
            <td valign="top"><table width="100%" border="0">
                <tr> 
                  <td width="95%" class="titleonwhite">Industry Areas</td>
                  <td width="5%">&nbsp;</td>
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Phosphoric Acid</td>
                  <td width="5%"> 
                    <input type="checkbox" name="industry" value="Phosphoric Acid"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Mining/Mineral Processing</td>
                  <td width="5%"> 
                    <input type="checkbox" name="industry" value="Mining/Mineral Processing"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Metallurgical Processing</td>
                  <td width="5%"> 
                    <input type="checkbox" name="industry" value="Metallurgical Processing"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Power Industry Applications</td>
                  <td width="5%"> 
                    <input type="checkbox" name="industry" value="Power Industry Applications"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Bulk Chemical Processing</td>
                  <td width="5%"> 
                    <input type="checkbox" name="industry" value="Bulk Chemical Processing"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Fine Chemical Processing</td>
                  <td width="5%"> 
                    <input type="checkbox" name="industry" value="Fine Chemical Processing"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Pharmaceutical Processes</td>
                  <td width="5%"> 
                    <input type="checkbox" name="industry" value="Pharmaceutical Processes"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Automotive Plant</td>
                  <td width="5%"> 
                    <input type="checkbox" name="industry" value="Automotive Plant"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Water & Waste Water Treatment</td>
                  <td width="5%"> 
                    <input type="checkbox" name="industry" value="Water & Waste Water Treatment"></td> 
                </tr>
                
              </table></td>
            <td valign="top"><table width="100%" border="0">
                <tr> 
                  <td width="95%" class="titleonwhite">Services</td>
                  <td width="5%">&nbsp;</td>
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Process Consulting</td>
                  <td width="5%"> 
                    <input type="checkbox" name="Processes" value="Process Consulting"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Service & Maintenance</td>
                  <td width="5%"> 
                    <input type="checkbox" name="Processes" value="Service & Maintenance"></td> 
                </tr>
                
                <tr bgcolor="#CCCCCC"> 
                  <td width="95%" valign="top" class="textonwhite">Commissioning & De-bottlenecking</td>
                  <td width="5%"> 
                    <input type="checkbox" name="Processes" value="Commissioning & De-bottlenecking"></td> 
                </tr>
                
              </table></td>
          </tr>
        </table>
      </form>
 
and your code in contact3.asp refers to Request.Form("Products"), Request.Form("industry") and Request.Form("Processes")???

Have you double-checked the spelling of these in both pages?


Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
I've just tested it again and it seems to work fine, I can not replicate the problem anyway.

Thanks for all your time.

Jon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top