Multiple selection + table

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

    Multiple selection + table

    Hi guys,
    I have a problem with multiple selection
    I have a list with 8 options in pull-down menu. For each option I have a price.
    Something like that :Element Price

    Table 10
    Sofa 20

    <SELECT NAME=myfurnitur e[] id=myfurniture[] class=third multiple>
    <OPTION VALUE="Table">T able </OPTION>
    <OPTION VALUE="Sofa">So fa</OPTION>.....



    I do that:



    foreach ($myfurniture As $Item)
    {
    echo "<li>" . $Item . "</li>";
    if($Item=True)
    {
    switch ($myfurniture)
    {
    case $myfurniture = "Table";

    echo "<p class=second>Pr ice is: <span class=five> 10;</span></p>";
    break;......


    But I receive the result only and always for the last element from myfurniture array


    Need help

    I didnt find anything to treat something like


    Thank You !!!
  • Darryl Porter

    #2
    Re: Multiple selection + table

    Your switch it using incorrect syntax, the case should simply look like the
    example below:

    case "TABLE":

    You do not need $myfurnaure ="Table";--this is wrong.

    Also, take note that I used a colon after my case statement and not a
    semi-colon.


    "Lori Costache" <ncostache@hotm ail.com> wrote in message
    news:9c19a131.0 307272232.7fee4 b4d@posting.goo gle.com...[color=blue]
    > Hi guys,
    > I have a problem with multiple selection
    > I have a list with 8 options in pull-down menu. For each option I have a[/color]
    price.[color=blue]
    > Something like that :Element Price
    >
    > Table 10
    > Sofa 20
    >
    > <SELECT NAME=myfurnitur e[] id=myfurniture[] class=third multiple>
    > <OPTION VALUE="Table">T able </OPTION>
    > <OPTION VALUE="Sofa">So fa</OPTION>.....
    >
    >
    >
    > I do that:
    >
    >
    >
    > foreach ($myfurniture As $Item)
    > {
    > echo "<li>" . $Item . "</li>";
    > if($Item=True)
    > {
    > switch ($myfurniture)
    > {
    > case $myfurniture = "Table";
    >
    > echo "<p class=second>Pr ice is: <span class=five> 10;</span></p>";
    > break;......
    >
    >
    > But I receive the result only and always for the last element from[/color]
    myfurniture array[color=blue]
    >
    >
    > Need help
    >
    > I didnt find anything to treat something like
    >
    >
    > Thank You !!![/color]


    Comment

    • Darryl Porter

      #3
      Re: Multiple selection + table

      correct:

      case "Table":

      NOT

      case "TABLE":

      "Darryl Porter" <dporter3@woh.r r.com> wrote in message
      news:0U3Va.2750 7$ib2.8603691@t wister.neo.rr.c om...[color=blue]
      > Your switch it using incorrect syntax, the case should simply look like[/color]
      the[color=blue]
      > example below:
      >
      > case "TABLE":
      >
      > You do not need $myfurnaure ="Table";--this is wrong.
      >
      > Also, take note that I used a colon after my case statement and not a
      > semi-colon.
      >
      >
      > "Lori Costache" <ncostache@hotm ail.com> wrote in message
      > news:9c19a131.0 307272232.7fee4 b4d@posting.goo gle.com...[color=green]
      > > Hi guys,
      > > I have a problem with multiple selection
      > > I have a list with 8 options in pull-down menu. For each option I have a[/color]
      > price.[color=green]
      > > Something like that :Element Price
      > >
      > > Table 10
      > > Sofa 20
      > >
      > > <SELECT NAME=myfurnitur e[] id=myfurniture[] class=third[/color][/color]
      multiple>[color=blue][color=green]
      > > <OPTION VALUE="Table">T able </OPTION>
      > > <OPTION VALUE="Sofa">So fa</OPTION>.....
      > >
      > >
      > >
      > > I do that:
      > >
      > >
      > >
      > > foreach ($myfurniture As $Item)
      > > {
      > > echo "<li>" . $Item . "</li>";
      > > if($Item=True)
      > > {
      > > switch ($myfurniture)
      > > {
      > > case $myfurniture = "Table";
      > >
      > > echo "<p class=second>Pr ice is: <span class=five> 10;</span></p>";
      > > break;......
      > >
      > >
      > > But I receive the result only and always for the last element from[/color]
      > myfurniture array[color=green]
      > >
      > >
      > > Need help
      > >
      > > I didnt find anything to treat something like
      > >
      > >
      > > Thank You !!![/color]
      >
      >[/color]


      Comment

      • Lori Costache

        #4
        Re: Multiple selection + table

        "Darryl Porter" <dporter3@woh.r r.com> wrote in message news:<xV3Va.275 13$ib2.8604387@ twister.neo.rr. com>...[color=blue]
        > correct:
        >
        > case "Table":
        >
        > NOT
        >
        > case "TABLE":
        >
        > "Darryl Porter" <dporter3@woh.r r.com> wrote in message
        > news:0U3Va.2750 7$ib2.8603691@t wister.neo.rr.c om...[color=green]
        > > Your switch it using incorrect syntax, the case should simply look like[/color]
        > the[color=green]
        > > example below:
        > >
        > > case "TABLE":
        > >
        > > You do not need $myfurnaure ="Table";--this is wrong.
        > >
        > > Also, take note that I used a colon after my case statement and not a
        > > semi-colon.
        > >
        > >[/color]
        >Thank You Darryl[/color]

        But STILL didnt work !!
        Have you ever try something similar with my table? I modified maybe 20
        times and 0, nada ! Im not specialist so please try to be pacient !

        Comment

        Working...