Form fields

From Kolmafia
Revision as of 09:32, 3 May 2010 by imported>Bale (moved Form field to Form fields: typo)
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()