Get all (selected or unselected) items in a multiple select box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • samvb
    New Member
    • Oct 2006
    • 228

    Get all (selected or unselected) items in a multiple select box

    Hi,

    is there anyway to get all items in a multiple select box using php? I use javascript to populate the select box but i don't want the visitor/user to select everytime he had added before clicking the "Process" selected items button. Hopefully someone will direct me to a php solution here.
  • TheServant
    Recognized Expert Top Contributor
    • Feb 2008
    • 1168

    #2
    There is, but it is a bit of fiddling. Basically you want to write some javascript which will do that as it populates the select box.

    I recommend what you do is print out a javascript array using PHP, and then have the javascript use that array to check if it needs to add HTML to say selected to the select box.

    Comment

    Working...