[thelist] ASP Mailform, Checkbox

Michele Foster michele at wordpro.on.ca
Wed Feb 28 13:13:08 CST 2001


Annie,

I'm no ASP or Form guru, but I think your problem is this ..

You're using the same name to capture all your fields.  Try the following
instead.

On your form page:

<input name="field1" type="text" size="20">
<input name="field2" type="text" size="20">
<input name="field3" type="text" size="20">

etc. for your specific fields

For radio buttons and check boxes, you need to use the same "Name", but
change the "Value" as required.

<input name="found" type="radio" value="E-Mail">E-Mail Notification
<input name="found" type="radio" value="Show">Met Us at a Show
<input name="found" type="radio" value="Newsgroup">Newsgroup
<input name="found" type="radio" value="Web Link">Other Web Site Link
<input name="found" type="radio" value="Advertising">Direct Advertising

The above will pass one value for "found"

OR

<input name="found" type="checkbox" value="E-Mail">E-Mail Notification
<input name="found" type="checkbox" value="Show">Met Us at a Show
<input name="found" type="checkbox" value="Newsgroup">Newsgroup
<input name="found" type="checkbox" value="Web Link">Other Web Site Link
<input name="found" type="checkbox" value="Advertising">Direct Advertising

The above will pass all values for "found" in a parsed string, i.e.
found=E-Mail,Show,Advertising


Then, on your processing forms, call your request.forms for each item.
(Assuming you are using Post and not Get).

So, you would (could) have the following, using the above examples,

strField1 = trim(request.form("field1"))
strField2 = trim(request.form("field2"))
strField3 = trim(request.form("field3"))
strFound = request.form("found")

Then you can create your output as required.

HTH,

Michele

----- Original Message -----
From: "aphelan (Andrea Phelan)" <aphelan at confederationc.on.ca>

> Hi :)
> Help? I'm making a mailform & I can't for the life of me remember how to
> process checkboxes
>
> if it helps, here's the format i'm using for text fields: strAC1 =
> trim(request.form("AC1"))
> and radio buttons: strAC1 = request.form("AC1")
>
> I'm just assigning the variables like that, & then writing it all owt like
> so:
> strEmail = "<font color='#3366CC' face='Arial' size='4'>Online Course
> Registration" &_
> "<BR>" &_
> "<BR>" &_
> "&nbsp; "& strAC1 &"</font></font>" &_
> etc...
> etc...






More information about the thelist mailing list