Sending data to database via radio button choice.

R

Renie83

Hi all! I was wondering does anyone have any ideas on how I can send
info to a SQL database by choosing a radio button. What I want to do
is set one radio button to "Max" and one to type "Avg". When a user
clicks on a radio button I want the value of whatever button was
chosen to be placed inside the "type" field in my database after they
hit submit. Also, if anyone knows of the best sites or books I can use
about VBScript or ASP please let me know. I'm learning them both right
now. Thank you very much!
Renie83
 
J

Joe Z

Renie83 said:
Hi all! I was wondering does anyone have any ideas on how I can send
info to a SQL database by choosing a radio button. What I want to do
is set one radio button to "Max" and one to type "Avg". When a user
clicks on a radio button I want the value of whatever button was
chosen to be placed inside the "type" field in my database after they
hit submit. Also, if anyone knows of the best sites or books I can use
about VBScript or ASP please let me know. I'm learning them both right
now. Thank you very much!
Renie83


Set the action of the form to the name of an asp page to process the form's
contents.

On that page, if the type radio button set has one button with value "Max"
and another with value "Avg" then the form element "type" will contain
either "Max" or "Avg" depending on which has been clicked by the user.

So on the asp page called by the form's action command you would use
request.form("type") to retrieve the value of the radio button set, which in
your example will be either "Max" or "Avg"

Then you would use ADO to update the database appropriately.
 
R

Renie83

Joe Z said:
Set the action of the form to the name of an asp page to process the form's
contents.

On that page, if the type radio button set has one button with value "Max"
and another with value "Avg" then the form element "type" will contain
either "Max" or "Avg" depending on which has been clicked by the user.

So on the asp page called by the form's action command you would use
request.form("type") to retrieve the value of the radio button set, which in
your example will be either "Max" or "Avg"

Then you would use ADO to update the database appropriately.

Thank you so much! That seems so obvious that I almost kicked myself.
I really appreciate your help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top