Incredibly Useful Form Maker

Jeremy Thomson, Jan 2006

The purpose of this script is to quickly and intellegently generate chunks of HTML code for use on forms without the tedium of writing them out manually. All output is XHTML compatible. Some clever PHP functionality is included.

(if different from name/ID)


(Seperate multiple value with commas)
quick fill this with: days names | days | months | years fwd | years bk | titles

(Optional)


Appearance on page:

Notes

* Error code option

This option inserts a chunk of PHP code into the form element to enable it to be highlighted in some way should its value found to be invalid. The PHP code checks for the presence of the element name in an array called $errored, and if found sets the style class name for the element to "errored".

** Autofill code option

This option inserts chunk(s) of PHP code into the form element in order to set its "value" attribte to some preset datum.

First, PHP checks whether $exist[name] is set. If so, the form element inherets this value. ($exist is assumed to be an array of existing information, most likely a record from a database query.)

Next, PHP checks $_REQUEST[name] and if set uses this value. This prevents data being lost when the form is unsuccessfully submitted.

For text and textarea elements only, if you enter any information in the "Value(s):" box above, this is set directly and autofill code is not included (think about it!).

Bug reports, questions and adulation to formmaker@jeremythomson.co.uk

Have fun