Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Jul 2008
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts

    POSTing an entire listbox

    Can someone help me here? I've got a listbox that im dynamically changing on my page (part of a form) and when I click the submit button I want to post all the contents of the listbox whether or not they're selected. Do I have to build a new variable in javascript to pass along or is there some way I can do this in PHP?

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    You could use multiple="multiple" attribute with the select tag, so that users can select more than one option by clicking the Ctrl key. (http://www.webmasterworld.com/forum91/1799.htm)

    With the help of javascript you can automate the "select all" procedure, see http://www.qodo.co.uk/blog/javascrip...-a-select-box/
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Jul 2008
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I want to submit all the contents whether selected or not. Am I going to have javascript select all the contents or can i post the list box as an array regardless?

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,866
    Thanks
    160
    Thanked 2,224 Times in 2,211 Posts
    You need to select the options (somehow) to get posted on submit.
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    New Coder
    Join Date
    Jul 2008
    Posts
    17
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ok thanks. there is one other thing ive just noticed. I had a working page where i could transfer options between listboxes that stopped working when i put the listboxes in a form. I was accessing the listboxes with their names using GetElementById --- do i need to change that now thier in a form?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •