How to select an option (from 2 choices)

Discussion in 'Programming' started by photosales.co.nz, Jul 3, 2007.

  1. #1
    Im working on a bit of a script, and have the following problem.

    I need to be able to choose from 2 different options, so far I have hard coded the following in:

    	<input type="hidden" name="table" value="members">
    	<input type="hidden" name="row" value="email">
    Code (markup):
    Now I also want to be able to select this as well

    	<input type="hidden" name="table" value="photographers">
    	<input type="hidden" name="row" value="email">
    Code (markup):
    Can this be done with a dropdown menu? or how can I get this done?

    I can not even se how to do it with buttons......
     
    photosales.co.nz, Jul 3, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    so you are wanting to ask people if they are members or photographers?

    little confused on what you are trying to achieve with the hidden fields
     
    AstarothSolutions, Jul 3, 2007 IP
  3. photosales.co.nz

    photosales.co.nz Peon

    Messages:
    371
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I am wanting to select to email either or
     
    photosales.co.nz, Jul 3, 2007 IP
  4. nico_swd

    nico_swd Prominent Member

    Messages:
    4,153
    Likes Received:
    344
    Best Answers:
    18
    Trophy Points:
    375
    #4
    
    Table:
    <select name="table">
        <option value="members">Members</option>
        <option value="photographers">photographers</option>
    </select>
    
    Row:
    <select name="row">
        <option value="email">Email</option>
        <option value="foo">Foo</option>
        <option value="bar">Bar</option>
    </select>
    
    HTML:
    Something like this?
     
    nico_swd, Jul 3, 2007 IP
  5. Acecool

    Acecool Peon

    Messages:
    267
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #5
    	<input type="radio" name="option['members']" value="members">
    	<input type="radio" name="option['photographer']" value="photographers">
    Code (markup):
    Select either or??
     
    Acecool, Jul 3, 2007 IP
  6. photosales.co.nz

    photosales.co.nz Peon

    Messages:
    371
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I have ended up hard coding the <input type="hidden" name="row" value="email"> in, and just done the drop down box for the 2 options, as the row is the same, it's just the table that changes.

    Sorry, just didn't juse my head enough on that one.
     
    photosales.co.nz, Jul 3, 2007 IP
  7. ProgrammersTalk

    ProgrammersTalk Peon

    Messages:
    684
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    #7
    to select either of, you can make it the same name=""
     
    ProgrammersTalk, Jul 3, 2007 IP