[Javascript] Control combination select

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #16
    Originally posted by viki1967
    Because so constructed the data form... are a lot data to be recorded on the form... without two select I rewriting the form and the page PHP processing data... no time...
    Yes, but with one select, there's less processing. The time that you're spending trying to validate you can use to change the PHP processing code.

    Comment

    • viki1967
      Contributor
      • Oct 2007
      • 263

      #17
      Originally posted by acoder
      Yes, but with one select, there's less processing. The time that you're spending trying to validate you can use to change the PHP processing code.
      OK, try last your suggestion...

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #18
        A quick question: how are you going to use the values, i.e. if "Frank" is selected, which value do you need? "Frank" or Japan?

        If you need the country values for each person, set the values of the options to the corresponding country for each person.

        Comment

        • viki1967
          Contributor
          • Oct 2007
          • 263

          #19
          Originally posted by acoder
          A quick question: how are you going to use the values, i.e. if "Frank" is selected, which value do you need? "Frank" or Japan?

          If you need the country values for each person, set the values of the options to the corresponding country for each person.
          Many options are possible but only one option from the second select is valid for each of the first selects.

          [html]
          <select>
          <option value="Frank, Japan">Frank, Japan</option>
          <option value="Anthony, Italy">Anthony, Italy</option>
          <option value="Max, England">Max, England</option>
          <option value="Mark, USA">Mark, USA</option>
          <option value="Vincent, Mexico">Vincent , Mexico</option>
          <option value="Jim, Spain">Jim, Spain</option>
          </select>
          [/html]

          In the page processing PHP I split the value at ", " and use the separate values.

          thanks!

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #20
            Excellent - nice and simple!

            Comment

            Working...