how to get multiple=multiple values from an optgroup ?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • nephish

    #1

    how to get multiple=multiple values from an optgroup ?

    hey there all,

    i have an html page that uses a select element with optgroups. I want
    multiple="multi ple"
    but when i pass it to the php script, i do not know how to get the
    values out.

    like this

    <select name="people" multiple="multi ple" >

    when this is submitted, are they passed as an array?

    thanks

  • Johnny

    #2
    Re: how to get multiple=multip le values from an optgroup ?


    "nephish" <nephish@gmail. comwrote in message
    news:1160764737 .443297.251860@ h48g2000cwc.goo glegroups.com.. .
    hey there all,
    >
    i have an html page that uses a select element with optgroups. I want
    multiple="multi ple"
    but when i pass it to the php script, i do not know how to get the
    values out.
    >
    like this
    >
    <select name="people" multiple="multi ple" >
    >
    when this is submitted, are they passed as an array?
    >
    thanks
    >
    make it name="people[]" then they will be..


    Comment

    • Andy Hassall

      #3
      Re: how to get multiple=multip le values from an optgroup ?

      On 13 Oct 2006 11:38:57 -0700, "nephish" <nephish@gmail. comwrote:
      >i have an html page that uses a select element with optgroups. I want
      >multiple="mult iple"
      >but when i pass it to the php script, i do not know how to get the
      >values out.
      >
      >like this
      >
      ><select name="people" multiple="multi ple" >
      >
      >when this is submitted, are they passed as an array?
      Change the name to "people[]" - this causes PHP to process it as an array.
      Otherwise you only get one of the selected values.

      --
      Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
      http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

      Comment

      • nephish

        #4
        Re: how to get multiple=multip le values from an optgroup ?

        well cool.
        Thought (hoped) it would be something that simple.

        cheers guys, and thanks for the help

        sk

        On Oct 13, 4:12 pm, Andy Hassall <a...@andyh.co. ukwrote:
        On 13 Oct 2006 11:38:57 -0700, "nephish" <neph...@gmail. comwrote:
        >
        i have an html page that uses a select element with optgroups. I want
        multiple="multi ple"
        but when i pass it to the php script, i do not know how to get the
        values out.
        >
        like this
        >
        <select name="people" multiple="multi ple" >
        >
        when this is submitted, are they passed as an array? Change the name to "people[]" - this causes PHP to process it as an array.
        Otherwise you only get one of the selected values.
        >
        --
        Andy Hassall :: a...@andyh.co.u k ::http://www.andyh.co.ukhttp://www.and....co.uk/space:: disk and FTP usage analysis tool

        Comment

        Working...