1WebCommon.incomingData(3kaya)Kaya module referenceWebCommon.incomingData(3kaya)
2
3
4

NAME

6       WebCommon::incomingData - Returns all values for the specified key from
7       user-supplied data
8

SYNOPSIS

10       [String] incomingData( String key, DataSource ds )
11

ARGUMENTS

13       key The key to retrieve data for
14
15       ds The source for user-supplied data
16

DESCRIPTION

18       Returns an array of all values for the  key  from  the  specified  data
19       source,  or throws a WebCommon.NotIncoming (3kaya) Exception if no such
20       key exists.
21
22
23    // GET /example.cgi?a=1;b=3;b=5;z=;z;z
24    vals = incomingData("a",DataGet);
25    // vals = ["1"]
26    vals = incomingData("b",DataGet);
27    // vals = ["3","5"]
28    vals = incomingData("c",DataGet);
29    // NotIncoming exception thrown
30    vals = incomingData("z",DataGet);
31    // vals = ["","",""]
32
33       This is useful for processing the output from forms  containing  check‐
34       boxes with the same name or multiple selects.
35
36
37    <form action='example.cgi' method='get'>
38     <fieldset><legend>Example form</legend>
39      <select multiple='multiple' name='a'>
40       <option value='1'>Option 1</option>
41       <option value='2'>Option 2</option>
42       <option value='3'>Option 3</option>
43       <option value='4'>Option 4</option>
44      </select>
45      <input type='submit' value='Test!'>
46     </fieldset>
47    </form>
48

AUTHORS

50       Kaya   standard  library  by  Edwin  Brady,  Chris  Morris  and  others
51       (kaya@kayalang.org). For further information see http://kayalang.org/
52

LICENSE

54       The Kaya standard library is free software;  you  can  redistribute  it
55       and/or  modify  it  under  the  terms  of the GNU Lesser General Public
56       License (version 2.1 or any later version) as  published  by  the  Free
57       Software Foundation.
58
60       WebCommon.DataSource (3kaya)
61       WebCommon.incomingExists (3kaya)
62       WebCommon.incomingKeys (3kaya)
63       WebCommon.incomingValue (3kaya)
64
65
66
67Kaya                             December 2010   WebCommon.incomingData(3kaya)
Impressum