Click to See Complete Forum and Search --> : email form - how to get value of radio group?


ucdcrush
07-05-2005, 02:10 PM
Hi - I have a form which I would like to add radio groups to, and would like to use the value of the radio groups in an email. I will show you how this is currently done with checkboxes on the form (but I get errors when I try to do apply this method to the radio group)...

The person who originally wrote this page had code like this at the top of the ASP file (further down, apple23 is a checkbox name):
-----------
dim applexp as string
[more definitions...]

If apple23.checked then
applexp = "Yes"
else
applexp = "No"

--------

The code which assembles the email looks something like this:
---------
<td><div align='left'><b>Phone: </b>" + applexp
[and more of these, one for each variable]
---------

As I said, this code works great.

I have attempted to create a radio group using dreamweaver, and named it "color". I set the values of the two buttons to "red" and "blue".

---------
So I figured I could go to the top, where the original developer made definitions, and add:
dim colortext as string

then in the IF section, add:
if color = red then
colortext = "red"
else
colortext = "blue"
-----

Then in the email part I simply changed code that worked for a checkbox from +apple23+ to +colortext+ to see if I could get the radio group value to show up..and I get errors the page doesn't load at all and I get a server runtime error message . I have tried putting quotes around "red" in the IF statement, and I have tried, in the email code, simply putting +color+ (and removing the IF then code since it seems redundant anyway).

Based on how the form does work with checkboxes, can someone tell me how I can use the value of a radio group in the email code?

Thanks
Dave

buntine
07-05-2005, 10:27 PM
Which errors?

This does not look like ASP/VBScript code. It looks more like Visual Basic.

Regards.