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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Sep 2006
    Location
    India Mumbai
    Posts
    248
    Thanks
    13
    Thanked 1 Time in 1 Post

    capturing data from from a drop down of multiple attribute

    Hi all,
    i have a dropdown whose data i fetch from DB.
    <select name="mySelect" multiple size=1></select> the problem is, if the user has selected more than one value it prints me only one. i print it this way :
    <?
    print_r($_POST['mySelect']);
    ?>

    i want to capture all the selected values. how will i do it??
    Thanks

  • #2
    Regular Coder
    Join Date
    May 2006
    Posts
    101
    Thanks
    0
    Thanked 1 Time in 1 Post
    This is because each option will overwrite the contents of the previous mySelect variable.
    You need to use PHP array here.
    like,
    PHP Code:
    <select name="mySelect[]" multiple size=1></select


  •  

    Posting Permissions

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