Form fields: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Bale
No edit summary
imported>Bale
mNo edit summary
 
(3 intermediate revisions by 2 users not shown)
Line 6: Line 6:
FunctionPage|
FunctionPage|
name={{#var:name}}|
name={{#var:name}}|
function_category=Relay Browser Functions|


function1={{Function|
function1={{Function|
Line 14: Line 13:
return_also={{#var:return_also}}|
return_also={{#var:return_also}}|
parameter1=|
parameter1=|
p1desc=Similiar to [[form_field|form_field()]], but returns a map with all the name/value pairs from the relay request being handled. Unlike the previous form_field() function, this allows iterating over all the fields,
p1desc=Similiar to [[form_field|form_field()]], but returns a map with all the name/value pairs from the relay request being handled. Unlike the [[form_field|form_field()]] function, this allows iterating over all the fields,
and can distinguish a field with a blank value from a nonexistent field.|
and can distinguish a field with a blank value from a nonexistent field. (The exception to this being checkboxes, which return no information when unchecked.)|
}}|
}}|


Line 29: Line 28:


see_also={{SeeAlso|form_field|write|writeln}}|
see_also={{SeeAlso|form_field|write|writeln}}|
more_info=See [[Relay_Override_Scripting#User_Interface_Script|User Interface Scripts]] for more information.|
}}
}}
[[Category:Relay Browser Functions]]

Latest revision as of 05:26, 22 May 2010

Function Syntax

string [string] form_fields()

  • Similiar to form_field(), but returns a map with all the name/value pairs from the relay request being handled. Unlike the form_field() function, this allows iterating over all the fields, and can distinguish a field with a blank value from a nonexistent field. (The exception to this being checkboxes, which return no information when unchecked.)

Used to read form information in User Interface Scripts.

Code Sample

Read the form fields in a UI script for use later.

string [string] fields;
fields = form_fields();
boolean success = count(fields) > 0;

See Also

form_field() | write() | writeln()

More Information

See User Interface Scripts for more information.