Retrieving full entry from multiple select list

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

    Retrieving full entry from multiple select list

    I have a list box with multiple selects. I define the name as numList[]. I
    get the values from

    $picked = $_POST['numList'];

    It retrieves values for all those selected.

    If the entries are, say,
    First
    Second
    Third

    and the first and third are select then $picked[0] has "First" and
    $picked[1] has "Third".
    If, however, the entries are:

    First one
    Second one
    Third one

    Then the values are for $picked[0] and $picked[1] are "First" and "Third"
    respecticely.
    How do I retrieve the entire value and not just the first word?

    Shelly


  • Ken Robinson

    #2
    Re: Retrieving full entry from multiple select list



    Shelly wrote:[color=blue]
    > If, however, the entries are:
    >
    > First one
    > Second one
    > Third one
    >
    > Then the values are for $picked[0] and $picked[1] are "First" and "Third"
    > respecticely.
    > How do I retrieve the entire value and not just the first word?[/color]

    How are you determining what is in each entry?

    If you do a
    <?
    echo '<pre>';print_r ($_POST);echo '</pre>';
    ?>
    after entering your processing script, what do you see?

    Ken

    Comment

    • Shelly

      #3
      Re: Retrieving full entry from multiple select list


      "Ken Robinson" <kenrbnsn@rbnsn .com> wrote in message
      news:1117493471 .919362.239190@ f14g2000cwb.goo glegroups.com.. .[color=blue]
      >
      >
      > Shelly wrote:[color=green]
      >> If, however, the entries are:
      >>
      >> First one
      >> Second one
      >> Third one
      >>
      >> Then the values are for $picked[0] and $picked[1] are "First" and "Third"
      >> respecticely.
      >> How do I retrieve the entire value and not just the first word?[/color]
      >
      > How are you determining what is in each entry?[/color]

      $picked = $_POST['numList'];
      [color=blue]
      > If you do a
      > <?
      > echo '<pre>';print_r ($_POST);echo '</pre>';
      > ?>
      > after entering your processing script, what do you see?[/color]

      I see:
      Array
      (
      [numList] => Array
      (
      [0] => First
      [1] => Third )

      [filename] =>
      [description] =>
      [submit] => Delete Entries
      )
      [color=blue]
      >
      > Ken
      >[/color]


      Comment

      • Ken Robinson

        #4
        Re: Retrieving full entry from multiple select list



        Shelly wrote:[color=blue]
        > "Ken Robinson" <kenrbnsn@rbnsn .com> wrote in message
        > news:1117493471 .919362.239190@ f14g2000cwb.goo glegroups.com.. .[color=green]
        > >
        > >
        > > Shelly wrote:[color=darkred]
        > >> If, however, the entries are:
        > >>
        > >> First one
        > >> Second one
        > >> Third one
        > >>
        > >> Then the values are for $picked[0] and $picked[1] are "First" and "Third"
        > >> respecticely.
        > >> How do I retrieve the entire value and not just the first word?[/color]
        > >
        > > How are you determining what is in each entry?[/color]
        >
        > $picked = $_POST['numList'];
        >[color=green]
        > > If you do a
        > > <?
        > > echo '<pre>';print_r ($_POST);echo '</pre>';
        > > ?>
        > > after entering your processing script, what do you see?[/color]
        >
        > I see:
        > Array
        > (
        > [numList] => Array
        > (
        > [0] => First
        > [1] => Third )
        >
        > [filename] =>
        > [description] =>
        > [submit] => Delete Entries
        > )[/color]

        So what you see is what you got.

        Next question: what does your form look like?

        Ken

        Comment

        • Shelly

          #5
          Re: Retrieving full entry from multiple select list


          "Ken Robinson" <kenrbnsn@rbnsn .com> wrote in message
          news:1117495150 .800178.47870@o 13g2000cwo.goog legroups.com...[color=blue]
          >
          >
          > Shelly wrote:[color=green]
          >> "Ken Robinson" <kenrbnsn@rbnsn .com> wrote in message
          >> news:1117493471 .919362.239190@ f14g2000cwb.goo glegroups.com.. .[color=darkred]
          >> >
          >> >
          >> > Shelly wrote:
          >> >> If, however, the entries are:
          >> >>
          >> >> First one
          >> >> Second one
          >> >> Third one
          >> >>
          >> >> Then the values are for $picked[0] and $picked[1] are "First" and
          >> >> "Third"
          >> >> respecticely.
          >> >> How do I retrieve the entire value and not just the first word?
          >> >
          >> > How are you determining what is in each entry?[/color]
          >>
          >> $picked = $_POST['numList'];
          >>[color=darkred]
          >> > If you do a
          >> > <?
          >> > echo '<pre>';print_r ($_POST);echo '</pre>';
          >> > ?>
          >> > after entering your processing script, what do you see?[/color]
          >>
          >> I see:
          >> Array
          >> (
          >> [numList] => Array
          >> (
          >> [0] => First
          >> [1] => Third )
          >>
          >> [filename] =>
          >> [description] =>
          >> [submit] => Delete Entries
          >> )[/color]
          >
          > So what you see is what you got.
          >
          > Next question: what does your form look like?[/color]

          The list show:

          First one
          Second one
          Third one

          Shelly


          Comment

          • Ken Robinson

            #6
            Re: Retrieving full entry from multiple select list



            Shelly wrote (in part):
            [color=blue][color=green]
            > > Next question: what does your form look like?[/color]
            >
            > The list show:
            >
            > First one
            > Second one
            > Third one[/color]

            No, what I mean is how are you defining your form, i.e. the HTML code.

            Ken

            Comment

            • Chung Leong

              #7
              Re: Retrieving full entry from multiple select list

              Looks like someone forgot to put quotation marks around the value
              attribute in the option tag...

              Comment

              Working...