Forum Moderators: open

Message Too Old, No Replies

pass radio button data from form to email

         

mightymid

4:33 pm on Jul 25, 2006 (gmt 0)

10+ Year Member



Hi all,

I have a form that includes these inputs:

First name: <input type="text" name="reg_first_name">

Last name: <input type="text" name="reg_last_name">

I will attend: <input type="radio" name="rsvp" value="yes">

I'm unable to attend: <input type="radio" name="rsvp" value="no">

They get passed to this script, which puts the data in the body of an email:

--------------

rsvpValue = request.form("rsvp")
Select Case ucase(rsvpValue)
case "yes"
response.write "Will Attend"
case "no"
response.write "Cannot Attend"
End Select

to_address = "foo@example.com"
receiver_name = request.form("RSVP Form")
mail_body = "Attending: " & response.write("rsvpValue") &vbcrlf &_
request.form("reg_first_name") & " " & request.form("reg_last_name") &vbcrlf &_

---------------

The name fields get passed. The rsvp fields do not.

I can't figure out what's going wrong. (I should mention I'm an asp novice....)

Would appreciate any advice.

Thanks!

mightymid

4:32 pm on Jul 26, 2006 (gmt 0)

10+ Year Member



Doh! Nevermind. I figured it out.

Changed this line:
mail_body = "Attending: " & response.write("rsvpValue") &vbcrlf &_

to this:
mail_body = "Attending: " & rsvpValue &vbcrlf &_

...and it works