Sending data to database via radio button choice.

Discussion in 'ASP General' started by Renie83, Jul 6, 2003.

  1. Renie83

    Renie83 Guest

    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, Jul 6, 2003
    1. Advertisements

  2. Renie83

    Joe Z Guest

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

    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.
    Joe Z, Jul 6, 2003
    1. Advertisements

  3. Renie83

    Renie83 Guest

    Thank you so much! That seems so obvious that I almost kicked myself.
    I really appreciate your help!
    Renie83, Jul 8, 2003
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.