Professional Web Applications Themes

Multiple selection + table - PHP Development

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=myfurniture[] id=myfurniture[] class=third multiple> <OPTION VALUE="Table">Table </OPTION> <OPTION VALUE="Sofa">Sofa</OPTION>..... I do that: foreach ($myfurniture As $Item) { echo "<li>" . $Item . "</li>"; if($Item=True) { switch ($myfurniture) { case $myfurniture = "Table"; echo "<p class=second>Price 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 ...

  1. #1

    Default 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=myfurniture[] id=myfurniture[] class=third multiple>
    <OPTION VALUE="Table">Table </OPTION>
    <OPTION VALUE="Sofa">Sofa</OPTION>.....



    I do that:



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

    echo "<p class=second>Price 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 !!!
    Lori Costache Guest

  2. #2

    Default 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" <ncostachehotmail.com> wrote in message
    news:9c19a131.0307272232.7fee4b4dposting.google.c om...
    > 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=myfurniture[] id=myfurniture[] class=third multiple>
    > <OPTION VALUE="Table">Table </OPTION>
    > <OPTION VALUE="Sofa">Sofa</OPTION>.....
    >
    >
    >
    > I do that:
    >
    >
    >
    > foreach ($myfurniture As $Item)
    > {
    > echo "<li>" . $Item . "</li>";
    > if($Item=True)
    > {
    > switch ($myfurniture)
    > {
    > case $myfurniture = "Table";
    >
    > echo "<p class=second>Price 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 Guest

  3. #3

    Default Re: Multiple selection + table

    correct:

    case "Table":

    NOT

    case "TABLE":

    "Darryl Porter" <dporter3woh.rr.com> wrote in message
    news:0U3Va.27507$ib2.8603691twister.neo.rr.com...
    > 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" <ncostachehotmail.com> wrote in message
    > news:9c19a131.0307272232.7fee4b4dposting.google.c om...
    > > 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=myfurniture[] id=myfurniture[] class=third
    multiple>
    > > <OPTION VALUE="Table">Table </OPTION>
    > > <OPTION VALUE="Sofa">Sofa</OPTION>.....
    > >
    > >
    > >
    > > I do that:
    > >
    > >
    > >
    > > foreach ($myfurniture As $Item)
    > > {
    > > echo "<li>" . $Item . "</li>";
    > > if($Item=True)
    > > {
    > > switch ($myfurniture)
    > > {
    > > case $myfurniture = "Table";
    > >
    > > echo "<p class=second>Price 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 Guest

  4. #4

    Default Re: Multiple selection + table

    "Darryl Porter" <dporter3woh.rr.com> wrote in message news:<xV3Va.27513$ib2.8604387twister.neo.rr.com>. ..
    > correct:
    >
    > case "Table":
    >
    > NOT
    >
    > case "TABLE":
    >
    > "Darryl Porter" <dporter3woh.rr.com> wrote in message
    > news:0U3Va.27507$ib2.8603691twister.neo.rr.com...
    > > 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.
    > >
    > >
    >Thank You Darryl
    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 !
    Lori Costache Guest

Similar Threads

  1. Auto-fill table cells in a selection
    By Roger_Pearse in forum Dreamweaver AppDev
    Replies: 2
    Last Post: March 23rd, 10:43 PM
  2. Howto loop through table cells in a selection
    By Roger_Pearse in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 3
    Last Post: March 23rd, 10:42 PM
  3. Replies: 0
    Last Post: July 23rd, 11:30 PM
  4. multiple selection box
    By Shaun Perry in forum Macromedia Flash Actionscript
    Replies: 0
    Last Post: February 12th, 01:24 PM
  5. UPDATE MULTIPLE ROWS IN ONE TABLE OBTAINING SUMS FROM ANOTHER TABLE
    By Jon Spartan in forum Microsoft SQL / MS SQL Server
    Replies: 2
    Last Post: July 9th, 04:48 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139