HighDots Forums  

Form - Only need checked box info

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Form - Only need checked box info in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
OlDirty
 
Posts: n/a

Default Form - Only need checked box info - 12-07-2005 , 11:32 AM






Hi,
I have a form set up for a client so that a visitor can check songs from a
list, and have the results emailed to the client.
The way I have it now is that the entire songlist is emailed, and every
checked box has the word "REQUESTED" after it. The client is requesting to have
only the songs that are checked to display.

Here's the url. Any help would be great. Thanks!

http://www.wmsgroup.com/client_temp/bestdjs/BestDjs_weddings_genre.htm


Reply With Quote
  #2  
Old   
Lionstone
 
Posts: n/a

Default Re: Form - Only need checked box info - 12-07-2005 , 11:57 AM






Give all the checkboxes the same name; make the value of the checkbox the
name of the song.
Request and write the checkbox one time, and you'll have a list. Ex:

Songs Requested:
<%=Request.Form("Songs")%>

becomes

Songs Requested:
Name of Song 1, Name of Song 2, Name of Song 3

If you want each song on a new line, it's still easy.
For text e-mail
<%=Replace(Request.Form("Songs"),", ", vbCrLf)%>

For HTML e-mail
<%=Replace(Request.Form("Songs"),", ","<br>")%>



Reply With Quote
  #3  
Old   
OlDirty
 
Posts: n/a

Default Re: Form - Only need checked box info - 12-07-2005 , 02:20 PM



Thank you very much. I will work on this today and let you know how it went for me!

Reply With Quote
  #4  
Old   
OlDirty
 
Posts: n/a

Default Re: Form - Only need checked box info - 12-07-2005 , 07:38 PM



I am having some trouble! After changing all the checkbox names and values,
what would I replace in the following code? All of the Request.Forms except the
one you noted? I deleted some to keep the message size down.

<%@ Language=VBScript %>
<%
'define variables from form
strdate = Request.Form("name")
strmonth = Request.Form("phone")
stremail = Request.Form("email")

'check that the form field has data
If Request.Form("name") = "" Then
Response.Redirect("formerror.asp")
End If

'check that the form field has data
If Request.Form("phone") = "" Then
Response.Redirect("formerror.asp")
End If

'check that the form field has data
If Request.Form("email") = "" Then
Response.Redirect("formerror.asp")
End If


strBody1 = "Back At One: " & Request.Form("1") & vbNewLine & "Air from Water
Music: " & Request.Form("96") & vbNewLine & "Arioso: " & Request.Form("97") &
vbNewLine & "Name: " & Request.Form("name") & vbNewLine & "Phone Number: " &
Request.Form("phone") & vbNewLine & "Email: " & Request.Form("email")

'prepare email to send
Set theMail = server.CreateObject("CDONTS.NewMail")
theMail.From = "andrew (AT) wmsgroup (DOT) com"
theMail.To = "andrew (AT) wmsgroup (DOT) com"
theMail.Subject = "Song List"
theMail.BodyFormat = 1
theMail.Importance = 2
theMail.Body = strBody1
theMail.Send
Set theMail = Nothing

%>


Reply With Quote
  #5  
Old   
Lionstone
 
Posts: n/a

Default Re: Form - Only need checked box info - 12-08-2005 , 09:30 AM



You change the part where you set up the song list:

strBody1 = "Name: " & Request.Form("name") & vbCrLf & "Phone Number: " &
Request.Form("phone") & vbCrLf & "Email: " & Request.Form("email") & vbCrLf
& "Song List: " & vbCrLf & Replace(Request.Form("Songs"),", ",vbCrLf)



Reply With Quote
  #6  
Old   
OlDirty
 
Posts: n/a

Default Re: Form - Only need checked box info - 12-08-2005 , 12:37 PM



Thank you so much Lionstone. You have saved my life! Happy Holidays!

Reply With Quote
  #7  
Old   
Lionstone
 
Posts: n/a

Default Re: Form - Only need checked box info - 12-08-2005 , 01:43 PM



Quote:
Thank you so much Lionstone. You have saved my life!
No problem.

Quote:
Happy Holidays!
You, too!




Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.