Professional Web Applications Themes

retrieving form checkbox values - PHP Development

I have a form which I want to post multiple values from one function to another using checkboxes. Having one value is simple- the form submits the value $File and is then retrieved in the target function via $_Request['File'] So far so good. Now I want to have multiple values for $File, because $File is a value assigned to a dynamically generated list of files in a folder (which will change from folder to folder). If I have multiple <input type=checkbox name=File value=$File> then only the last value is posted to the next function and retrieved by $_Request['File'] How can ...

  1. #1

    Default retrieving form checkbox values

    I have a form which I want to post multiple values from one function to another using checkboxes.

    Having one value is simple- the form submits the value $File and is then retrieved in the target function via $_Request['File']
    So far so good.

    Now I want to have multiple values for $File, because $File is a value assigned to a dynamically generated list of files in a folder
    (which will change from folder to folder).

    If I have multiple <input type=checkbox name=File value=$File> then only the last value is posted to the next function and retrieved
    by $_Request['File']

    How can I post and retrieve all values of $File or am I going about this the wrong way?

    Thanks

    Caspar Kennerdale Guest

  2. #2

    Default Re: [PHP] retrieving form checkbox values

    On Thursday 17 July 2003 16:45, caspar kennerdale wrote:
    > I have a form which I want to post multiple values from one function to
    > another using checkboxes.
    >
    > Having one value is simple- the form submits the value $File and is then
    > retrieved in the target function via $_Request['File'] So far so good.
    >
    > Now I want to have multiple values for $File, because $File is a value
    > assigned to a dynamically generated list of files in a folder (which will
    > change from folder to folder).
    >
    > If I have multiple <input type=checkbox name=File value=$File> then only
    > the last value is posted to the next function and retrieved by
    > $_Request['File']
    >
    > How can I post and retrieve all values of $File or am I going about this
    > the wrong way?
    manual > PHP and HTML

    Or search the archives and/or ask google.

    --
    Jason Wong -> Gremlins Associates -> [url]www.gremlins.biz[/url]
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    ------------------------------------------
    Search the list archives before you post
    [url]http://marc.theaimsgroup.com/?l=php-general[/url]
    ------------------------------------------
    /*
    My doctor told me to stop having intimate dinners for four. Unless there
    are three other people.
    -- Orson Welles
    */

    Jason Wong Guest

  3. #3

    Default RE: [PHP] retrieving form checkbox values


    I think you have to do <input type=checkbox name=File[]>
    Then $File becomes an array. If you want to retrieve the value for each
    checkbox you can use a for loop and do value=$File[$i]

    -----Original Message-----
    From: Jason Wong [mailto:php-generalgremlins.biz]
    Sent: 17. jl 2003 08:58
    To: [email]php-generallists.php.net[/email]
    Subject: Re: [PHP] retrieving form checkbox values

    On Thursday 17 July 2003 16:45, caspar kennerdale wrote:
    > I have a form which I want to post multiple values from one function
    to
    > another using checkboxes.
    >
    > Having one value is simple- the form submits the value $File and is
    then
    > retrieved in the target function via $_Request['File'] So far so good.
    >
    > Now I want to have multiple values for $File, because $File is a value
    > assigned to a dynamically generated list of files in a folder (which
    will
    > change from folder to folder).
    >
    > If I have multiple <input type=checkbox name=File value=$File> then
    only
    > the last value is posted to the next function and retrieved by
    > $_Request['File']
    >
    > How can I post and retrieve all values of $File or am I going about
    this
    > the wrong way?
    manual > PHP and HTML

    Or search the archives and/or ask google.

    --
    Jason Wong -> Gremlins Associates -> www.gremlins.biz
    Open Source Software Systems Integrators
    * Web Design & Hosting * Internet & Intranet Applications Development *
    ------------------------------------------
    Search the list archives before you post
    http://marc.theaimsgroup.com/?l=php-general
    ------------------------------------------
    /*
    My doctor told me to stop having intimate dinners for four. Unless
    there
    are three other people.
    -- Orson Welles
    */


    --
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, visit: http://www.php.net/unsub.php


    Svlyp Guest

Similar Threads

  1. Retrieving values from DataGrid row before update
    By greenb in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: May 14th, 03:33 PM
  2. Retrieving Hyperlink parameter values in PHP
    By Charlie-Boo in forum PHP Development
    Replies: 1
    Last Post: December 6th, 08:11 AM
  3. problem retrieving value from DB into a checkbox
    By Maria Kovacs in forum ASP Database
    Replies: 8
    Last Post: September 25th, 09:31 PM
  4. retrieving multi-select form values
    By Hank Tt in forum PHP Development
    Replies: 2
    Last Post: July 31st, 06:14 PM
  5. [PHP] retrieving form checkbox values
    By Marek Kilimajer in forum PHP Development
    Replies: 0
    Last Post: July 17th, 09:57 AM

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