SELECT CASE CHECKBOX PROBLEM

# Thread: SELECT CASE CHECKBOX PROBLEM

1. Senior Member
Join Date
Dec 1969
Posts
226

## SELECT CASE CHECKBOX PROBLEM

The below code just sending the msg "no1" in any case..i mean if<BR>i select "no2", it is sending "no1" again.<BR>Also "checkbox" means multi-selection but it&#039;s sending just one,<BR>even always "no1".<BR>Pls Help<BR> <BR>&#060;%<BR><BR>Set mailobj = CreateObject("CDONTS.NewMail")<BR>mailobj.From = "kerem"<BR>mailobj.Subject = "Ýþ Baþvurusu Formu" <BR>mailobj.To = Request.Form ("email")<BR>Select Case Request.Form("checkbox")<BR>Case no1<BR>body = "Body of email message no1"<BR>Case no2<BR>body = "Body of email message no2"<BR>Case no3<BR>body = "Body of email message no3"<BR>Case no4<BR>body = "Body of email message no4"<BR>End Select<BR>mailobj.Body = body<BR>mailobj.BodyFormat = 0<BR>mailobj.MailFormat = 0<BR>mailobj.Send <BR>set mailobj = Nothing<BR><BR>%&#062;<BR>

2. Senior Member
Join Date
Dec 1969
Posts
3,921

## Put your case values in quotes...

...Case "no1"<BR> Case "no2"<BR><BR> You may also want to Trim(Request("checkbox"))

3. Senior Member
Join Date
Dec 1969
Posts
226

## Still sending no1 :)

Still sending no1 :)<BR>i tnink this will not work

4. Senior Member
Join Date
Dec 1969
Posts
3,921

## RE: Still sending no1 :)

What value is contained in this when you do a response.write Request.Form("checkbox") ?<BR><BR>Perhaps the problem is higher up in your HTML code...<BR><BR><BR>

5. Senior Member
Join Date
Dec 1969
Posts
226

## RE: Still sending no1 :)

i better send you the complete code.....<BR>FORM PAGE:&#060;form method="POST" action="asp.asp"&#062;<BR>&#060;input type="text" name="email" size="20"&#062;<BR>&#060;p&#062;<BR>&#060;input type="checkbox" name="no1" value="a"&#062;no1<BR><BR>&#060;input type="checkbox" name="no2" value="b"&#062;no2<BR><BR>&#060;input type="checkbox" name="no3" value="c"&#062;no3<BR><BR>&#060;input type="checkbox" name="no4" value="d"&#062;no4<BR>&#060;/p&#062;<BR>&#060;p&#062;<BR>&#060;input type="submit" value="send"&#062;<BR>&#060;input type="reset" value="reset"&#062;<BR>&#060;/p&#062;<BR>&#060;/form&#062;<BR><BR>ASP PAGE:<BR>&#060;%<BR><BR>Set mailobj = CreateObject("CDONTS.NewMail")<BR>mailobj.From = "george"<BR>mailobj.Subject = "anything" <BR>mailobj.To = Request.Form ("email")<BR>Select Case Trim(Request.Form("checkbox"))<BR>Case no1<BR>body = "Body of email message no1"<BR>Case no2<BR>body = "Body of email message no2"<BR>Case no3<BR>body = "Body of email message no3"<BR>Case no4<BR>body = "Body of email message no4"<BR>End Select<BR>mailobj.Body = body<BR>mailobj.BodyFormat = 0<BR>mailobj.MailFormat = 0<BR>mailobj.Send <BR>set mailobj = Nothing<BR><BR>%&#062;<BR><BR><BR>

6. Senior Member
Join Date
Dec 1969
Posts
3,921

## Ah....

The checkboxes can only = a,b,c, or d. There are only checkboxes named no1,no2,no3, and no4. There isn&#039;t one named "checkbox".

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•