submit multiple values from a list box PHP

Ask a Question related to Adobe Dreamweaver & Contribute, Design and Development.

  1. #1

    Default submit multiple values from a list box PHP

    Can any one tell me how to submit multiple values from a list box? I believe it
    has something to do with Arrays or Loops but i'm not sure. this is this list
    box code. As you can see it is populated by the products database. Could
    somebody show me what the array loop thing is supposed to look like. So this
    list box submits multiple values. At the moment when you submit the form all
    that is entered into the database is the word Array not the values of the list
    box. Do I need to change the setting in the mySQL datbase. At the moment the
    field it is entered into is Text. <select name='vehicle_type[]' size='20'
    multiple> <?php do { ?> <option value='<?php echo
    $row_rsProducts['vehicle_type']?>' ><?php echo
    $row_rsProducts['vehicle_type']?></option> <?php } while ($row_rsProducts =
    mysql_fetch_assoc($rsProducts)); ?></select> much appreciated Thank you :0)

    DennisMcDougall Guest

  2. Similar Questions and Discussions

    1. Mail values from a List with Multiple Selections with PHP
      Hi, I have a little problem, I have a HTML-mailform with a List/Menu (named informatie) witch allows Multiple Selections (Hold CTRL-key and...
    2. multiple select list default values (asp/vb)
      (asp/vb) Hi all, I have a multiple select list on an insert record form. I can make multiple selections and insert them into the database...
    3. multiple menu/list values inserted into one mysql column
      Simple problem here for the pros I'm sure. I have constructed a "rockshow" database in mysql for local music artists/bands and I made an input form...
    4. Multiple Values in a list box
      Hi everybody. If anyone can tell me how can I choose multiple values in a list box (by using ctrl or shift buttons) and store them in a table....
    5. Selecting Multiple Values in a List/Combo Box
      The following should work: On your close button add the following line before the close command getWellList docmd.close
  3. #2

    Default Re: submit multiple values from a list box PHP

    Normally you'd access this via $_POST['vehicle_type'] but because there is more
    than one value $_POST['vehicle_type'] is an array. if you do a
    print_r($_POST['vehicle_type']) you will see all your selected values inside.
    What you do with them depends on what you need them for.
    foreach($_POST['vehicle_type'] as $vehicle_type) { echo $vehicle_type; }
    will print them all out. But you can do anything else in place of that echo
    statement... Ross

    Ross Riley Guest

  4. #3

    Default Re: submit multiple values from a list box PHP

    You will find an extension for this purpose in Macromedia Exchange, the name is Multiple Selection

    Felix
    [email]webmaster@felixone.it[/email]
    [url]http://www.felixone.it[/url]
    Felix1 Guest

  5. #4

    Default Re: submit multiple values from a list box PHP

    That Ross that worked a treat :0)
    DennisMcDougall Guest

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