how to get all values from an select box when no value is selected

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vjayis
    New Member
    • Mar 2008
    • 134

    how to get all values from an select box when no value is selected

    hi

    i m having a select box with multiple select option in registration form

    so the user can select more than one option at a time and i got those selected

    values by declaring the select box name as "category[]" which works fine.,

    Is there any way to get all the values that are listed in the selectbox when no

    value is selected??

    If it could be done, can anyone tell me how to get it through php..


    regards
    vijay
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    Hey.

    That would require you to either:
    1. Make client-side code that automatically selects all elements in the select before the form is submitted, if none of them are selected.
    2. Have the values stored server-side and use them if the select box is submitted empty.


    Which one should be used depends on how your select box works. How it is poulated.

    Comment

    • vjayis
      New Member
      • Mar 2008
      • 134

      #3
      thank u for your reply.,

      hope i can go with the first option..

      Comment

      Working...