HTML forms: Pull Down Menu (beginner)

Discussion in 'HTML & Website Design' started by askscript, Nov 9, 2008.

  1. #1
    Hi,

    Many a times, a value is being assign to the options in the pull down menu.

    How does one knows what value it has to be assigned to. Is there a reason for a value to be assigned?

    E.g.

    <option value="TGIF"> Friday</option>
     
    askscript, Nov 9, 2008 IP
  2. garrettheel

    garrettheel Peon

    Messages:
    341
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I use a value when I'm filling the options in dynamically from the database and use the ID as the value.
     
    garrettheel, Nov 9, 2008 IP
  3. askscript

    askscript Member

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    ok that means the value is the ID. ID in database is 'TIGF', therefore it is used as a value in the options.
     
    askscript, Nov 9, 2008 IP
  4. garrettheel

    garrettheel Peon

    Messages:
    341
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Well, that's what I use it for. But if it's a dynamic website then it's more then likely that TIGF coressponds to some item in a database.
     
    garrettheel, Nov 10, 2008 IP
  5. askscript

    askscript Member

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #5
    i am trying to understand if the 'TGIF' value is already in the database and we need to find that out first before we use the value in the options

    OR
    is it that

    We just assign any value as we like it and it will imprint into the database consequently.
     
    askscript, Nov 10, 2008 IP
  6. garrettheel

    garrettheel Peon

    Messages:
    341
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Well, if it's a dynamic site then it's pretty much guaranteed that TGIF is somewhere in the database and that it corresponds to something. But it's hard to say without seeing the database schema
     
    garrettheel, Nov 10, 2008 IP
  7. askscript

    askscript Member

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #7
    If it is not a dynamic website, i can add in any value terms i want. It seems like many profitable sites are dynamic.
     
    askscript, Nov 11, 2008 IP