Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combo Values to DB via ASP

Status
Not open for further replies.

auger

Technical User
Oct 27, 2001
48
CA
I'm trying to take values from combo boxes and radio buttons on a single web form and pass them to my db.

Combos are set up thusly:

<select name=&quot;selectOptions1&quot;>
<option value=&quot;1&quot;>Option1</option>
<option value=&quot;2&quot;>Option2</option>
<option value=&quot;3&quot;>Option3</option>
<option value=&quot;4&quot;>OptionEtc</option>
</select>

Radios are setup thusly:

<div align=&quot;center&quot;>
<input type=&quot;radio&quot; name=&quot;RadioSet1&quot; value=&quot;1&quot;>
<input type=&quot;radio&quot; name=&quot;RadioSet1&quot; value=&quot;2&quot;>
<input type=&quot;radio&quot; name=&quot;RadioSet1&quot; value=&quot;3&quot;>
</div>

SQL looks like this:

cmdSQLinsert = &quot;insert into tblInput (selectOptions1,_ RadioSet1) values ('&quot; & Field1ID & &quot;', '&quot; & Field2ID & &quot;' )&quot;

etc.

I know the db connection is okay because my db is updating the RecordID which is an Access autonumber. The form values are not being passed though. I just get a table full of autonumbers.

Any suggestions?

Thanks in advance.
 
Do you have something like this before your SQL statement?

Field1ID = request(&quot;selectOptions1&quot;)
Field2ID = request(&quot;RadioSet1&quot;)

It must be submitted first of course.


 
Uh huh,

Field1ID = Request.Form(&quot;selectOptions1&quot;)
Field2ID = Request.Form(&quot;RadioSet1&quot;)

Haven't tried your syntax: request(&quot;selectOptions1&quot;)

Think it'll make a diff?
 
Oh m'God. Had the wrong form element names for the objects. Doh!

Thanks for your help...made me look again!

What's that crocodile guy say? Crikey! =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top