Difference between revisions of "Htmlform"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(forgot this important effect)
imported>Bale
(Adding some functions. Joy.)
Line 5: Line 5:
 
== Functions ==
 
== Functions ==
  
 +
=== Generating the Page Structure ===
 
{{HideLink|write_header}}{{Function|
 
{{HideLink|write_header}}{{Function|
 
name=write_header|
 
name=write_header|
 
return_type=void|
 
return_type=void|
 
}}
 
}}
Writes the header, yo.
+
{{Function|
 +
name=finish_header|
 +
return_type=void|
 +
}}
 +
{{Function|
 +
name=write_page|
 +
return_type=void|
 +
}}
 +
write_page() is equivalent to write_header() followed by finish_header(), but the separate functions may be preferred so that you can add information into the page header such as a script or stylesheet.
  
 +
{{HideLink|finish_page}}{{Function|
 +
name=finish_page|
 +
return_type=void|
 +
}}
 +
This must be used at the end of the form.
 +
 +
{{HideLink|write_box}}{{Function|
 +
name=write_box|
 +
parameter1={{Param|string|label}}|
 +
return_type=void|
 +
}}
 +
{{Function|
 +
name=finish_box|
 +
return_type=void|
 +
}}
 +
These can be used in matched pairs around a group of elements to enclose them in a box. The label will be at the top of the box.<br />
 +
'''attr("align=center")''' or '''attr("align=right")''' will change the position of the label.
  
 
== Making use of HTMLform ==
 
== Making use of HTMLform ==

Revision as of 10:36, 29 November 2010

About jasonharper's Form Library

It does stuff with forms. Like Magic. Also, it turns your body into html so that all your attacks will do html damage. This is obviously placeholder text, duh.

Functions

Generating the Page Structure

write_header

void write_header()

void finish_header()

void write_page()

write_page() is equivalent to write_header() followed by finish_header(), but the separate functions may be preferred so that you can add information into the page header such as a script or stylesheet.


finish_page

void finish_page()

This must be used at the end of the form.


write_box

void write_box(string label )

void finish_box()

These can be used in matched pairs around a group of elements to enclose them in a box. The label will be at the top of the box.
attr("align=center") or attr("align=right") will change the position of the label.

Making use of HTMLform

To include this library in your script, simply add the following towards the top of your script:

import "htmlform.ash";

Then all these functions will be available in your script. Have fun!

More Information

See the thread for HTMLform on the KoLmafia forum here.