Form fields

From Kolmafia
Revision as of 09:31, 3 May 2010 by imported>Bale (Created page with '{{ #vardefine:name|form_fields}}{{ #vardefine:return_type|string [string]}}{{ #vardefine:aggregate|yes}}{{ FunctionPage| name={{#var:name}}| function_category=Relay Browser Func…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

string form_fields(string value )

  • Returns the value attribute of a previously-submitted input tag.

string [string] form_fields()

  • As above, but returns as 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, and can distinguish a field with a blank value from a nonexistent field.

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

write() | writeln()