Print Page | Close Window

checkbox problem is driving me crazy

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5998
Printed Date: 29 March 2026 at 4:41am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: checkbox problem is driving me crazy
Posted By: l_baltodano
Subject: checkbox problem is driving me crazy
Date Posted: 26 September 2003 at 1:34pm

hi people.. i hope you can help me because iīm really about to cry.. well.. i canīt figure it out by my self so .. here is my question.

I have this email form wich is meant to go through an asp page and then sent to 2 mail boxes.. the thing is that iīm using checkboxes to let my visitors choose among many options.. but when the mail comes to my inbox the choise that has been made by the user doesnīt seem to be processed by the asp page...hereīs the code that iīm using to write my email (CDONTS)..and yes the checkboxes names are correct

'Initialse the var for the body
strBody = "<h2>E-mail sent from the Sponsorship Response Form .-La Gala-.</h2>"
strBody = strBody & "<br><b>Contact Name: </b>" & Request.Form("SRFCName")
strBody = strBody & "<br><br><b>Company: </b>" & Request.Form("SRFComp")
strBody = strBody & "<br><br><b>Address: -</b>" & Request.Form("SRFAd")
strBody = strBody & "<br><br><b>Telephone: </b>" & Request.Form("SRFPho")
strBody = strBody & "<br><br><b>Fax: </b>" & Request.Form("SRFFax")
strBody = strBody & "<br><br><b>E-mail: </b>" & Request.Form("SRFEmail")
strBody = strBody & "<br><br><b>The Company wants to be a: </b>"
If (Request.Form("SRF01")) = "on" Then
 strBody = strBody & "<br>Gala Benefactor"
End If
If (Request.Form("SRF02")) = "on" Then
 strBody = strBody & "<br>Gala Patron"
End If
If (Request.Form("SRF03")) = "on" Then
 strBody = strBody & "<br>Gala Mentor"
End If
If (Request.Form("SRF04")) = "on" Then
 strBody = strBody & "<br>Gala Contributor"
End If
If (Request.Form("SRF05")) = "on" Then
 strBody = strBody & "<br>Gala Friend"
End If
strBody = strBody & "<br><br><b>Payment Method:</b>"
If (Request.Form("SRF06")) = "on" Then
 strBody = strBody & "<br>We have enclosed our advertisement artwork"
End If

plz.. i need some help to figure out whatīs wrong with my code

Lau




Replies:
Posted By: pmormr
Date Posted: 26 September 2003 at 2:03pm

post the source code of the page with the checkboxes. there might be something wrong with that page..



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: l_baltodano
Date Posted: 26 September 2003 at 2:18pm

hi pmormr.. this is the code for my checkboxes

<input type="checkbox" name="SRF01" value="ON">Gala Benefactor $ 20,000.00<br>
<input type="checkbox" name="SRF02" value="ON"> Gala Patron $ 15,000.00<br>
<input type="checkbox" name="SRF03" value="ON"> Gala Mentor $ 12,000.00<br>
<input type="checkbox" name="SRF04" value="ON"> Gala Contributor $ 6,000.00<br>
<input type="checkbox" name="SRF05" value="ON"> Gala Friend $ 3,000.00<br>



Posted By: pmormr
Date Posted: 26 September 2003 at 2:46pm

make sure that you have a form tag with a method set to POST. u may also want to try removing your parenthesis around your Request.Form's in your code.

That is really expensive to be just a friend.



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: l_baltodano
Date Posted: 26 September 2003 at 2:51pm

jejee. ok.. hereīs the complete form's code

<!--Inicia el Formulario de Sponsorship-->
                        <form method="post" action="send_email.asp">
                          <span style="font-size: 9pt">
                          Our company would like to become a sponsor at the
                          following level: (Please mark one box)<br>
                          <br>
                          <span lang="es">&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;
                          </span>
                          <input type="checkbox" name="SRF01" value="ON"><span lang="es">
                          </span>Gala Benefactor $ 20,000.00<br>
                          <span lang="es">&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;
                          </span>
                          <input type="checkbox" name="SRF02" value="ON"> Gala Patron $ 15,000.00<br>
                          <span lang="es">&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;
                          </span>
                          <input type="checkbox" name="SRF03" value="ON"> Gala Mentor $ 12,000.00<br>
                          <span lang="es">&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;
                          </span>
                          <input type="checkbox" name="SRF04" value="ON"> Gala Contributor $ 6,000.00<br>
                          <span lang="es">&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;
                          </span>
                          <input type="checkbox" name="SRF05" value="ON"> Gala Friend $ 3,000.00<br>
&nbsp;</span></font></p>
                          <table border="0" cellpadding="0" cellspacing="3" style="border-collapse: collapse" bordercolor="#111111" width="98%" id="AutoNumber12">
                            <tr>
                              <td width="19%"><font face="Arial">
                        <span style="font-size: 9pt">
                        Company:</span></font></td>
                              <td width="81%">
                              <input type="text" name="SRFComp" size="39" style="font-size: 9px; font-family: Arial"></td>
                            </tr>
                            <tr>
                              <td width="19%"><font face="Arial">
                        <span style="font-size: 9pt">
                        Contact Name:</span></font></td>
                              <td width="81%">
                              <input type="text" name="SRFCName" size="39" style="font-size: 9px; font-family: Arial"></td>
                            </tr>
                            <tr>
                              <td width="19%"><font face="Arial">
       &n



Posted By: pmormr
Date Posted: 26 September 2003 at 3:00pm

Does it give you an error, or does it just not send the email?



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: l_baltodano
Date Posted: 26 September 2003 at 3:15pm

it actually doesnīt give me errors but when i receive the email it shows up like this:

E-mail sent from the Sponsorship Response Form .-La Gala-.


Contact Name: Lautaro Baltodano

Company: DreamXplorer

Address: -Managua, Nicaragua

Telephone: 08816971

Fax: 2705891

E-mail: l_baltodano@yahoo.com

The Company wants to be a:

Payment Method:

did u noted the empty fields?.. thatīs the problem



Posted By: pmormr
Date Posted: 26 September 2003 at 3:25pm
try using radio buttons instead of checkboxes...

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: l_baltodano
Date Posted: 26 September 2003 at 3:31pm
do u know a good tutorial using radio buttons?


Posted By: pmormr
Date Posted: 26 September 2003 at 3:32pm
try searching google.

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: l_baltodano
Date Posted: 26 September 2003 at 3:36pm
ok.. thanks anyway .. in anycase if i get stucked again.. may i ask u for more assistance?


Posted By: pmormr
Date Posted: 26 September 2003 at 3:39pm

certanly



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: l_baltodano
Date Posted: 26 September 2003 at 6:15pm

hi pmormr .. look... iīve tried my best with no success .

Plz.. iīve cleaned my ".html" page and the ".asp" page.. i wanna know if you would like to take a look directly onīem ... is there any chance that you receive them in your inbox?.. itīs a 3kb zipped file... please.. i really wanna know how to do it.. my email is mailto:linux_richard@hotmail.com - linux_richard@hotmail.com .. plz.. answer me if you aggreed to look atīem.



Posted By: l_baltodano
Date Posted: 26 September 2003 at 6:16pm
by the way.. i also tried with the radio buttons code and had no success either!


Posted By: KCWebMonkey
Date Posted: 26 September 2003 at 6:36pm

If a checkbox is checked, it automatically get's a value of "on", so don't give the input an initial value:

<input type="checkbox" name="myCheckbox">

If it get's checked in the form and then submitted:

Dim varCheckbox
varCheckbox = Request.Form("myCheckbox")

varCheckbox will have a value of "on" (as a text string)

 

Does this make sense or should i elaborate more???



Posted By: fernan82
Date Posted: 27 September 2003 at 12:58am

Yea but the value="on" shouldn't hurt at all.... should it?

I don't see nothing wrong with it, post the full code of both files so I can copy it and try it....

Also this might sound stupid but try the following:

Remove the xtra parenthesis from the request.form and change the "on" to caps change it to something like this:

If Request.Form("SRF01") = "ON" Then

also try something like this:

If Request.Form("SRF01") <> "" Then

Sounds stupid but with MS technology anything can happen....

If you want you can post both files so I can copy them and be able to figure what's wrong.



Posted By: l_baltodano
Date Posted: 27 September 2003 at 11:36am

thank you very much everybody.. speccially you pmormr .. it works like a charm now , and hereīs the code that made it possible..(Easy but tricky "AT LEAST FOR ME")

'Initialse strBody string with the body of the e-mail
strBody = "<h2>E-mail sent from the Sponsorship Response Form .-La Gala-.</h2>"
strBody = strBody & "<br><b>Contact Name: </b>" & Request.Form("SRFCName")
strBody = strBody & "<br><br><b>Company: </b>" & Request.Form("SRFComp")
strBody = strBody & "<br><br><b>Address: -</b>" & Request.Form("SRFAd")
strBody = strBody & "<br><br><b>Telephone: </b>" & Request.Form("SRFPho")
strBody = strBody & "<br><br><b>Fax: </b>" & Request.Form("SRFFax")
strBody = strBody & "<br><br><b>E-mail: </b>" & Request.Form("SRFEmail")
strBody = strBody & "<br><br><b>The Company wants to be a: </b>"

'I'm going to look at your rating buttons, and find the level from there
sponlevel = Request.Form("sp_level")
strBody = strBody & sponlevel

strBody = strBody & "<br><br><b>Artwork Enclosed?:</b>"

If Request.Form("SRF06") = "ON" Then
 strBody = strBody & "<br>Yes"
 Else
 strBody = strBody & "<br>No"
End If

Thank you pmormr, you saved my day



Posted By: fernan82
Date Posted: 27 September 2003 at 4:47pm
So you just remove the parentesis and change the ON to caps, I thought I was the one who suggested that


Posted By: pmormr
Date Posted: 27 September 2003 at 5:02pm
i changed about 30 lines of code... look at the second one and compare it too the first one.

-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net