QZ Forms

Prompt Rules

A prompt rule tells QZ Forms how to turn an attribute from a PostgreSQL SELECT statement into a data entry field.

form_name
fieldname
A prompt rule is uniquely identified by the (form name, fieldname) tuple. If the SELECT statement renames an attribute, e.g. "SELECT afield "MyName" FROM..." the fieldname would be MyName.
prompt_type
Determines what kind of prompt to create. Each prompt type specifies a particular function in C that will create a particular input type.
tabindex
The order the fields will be selected.
el_class
A class name that is added to the HTML element. Each field gets a class name of its fieldname. This allows an additional class to be specified.
readonly
If set, the field will not be editable.
rows
cols
For textarea fields, these will set the height and width of the data entry box.
size
maxlength
For input text, the size sets the width of the input and maxlength sets the number of characters allowed.
options
For HTML drop down lists and radio buttons a list of allowed options may be specified. Note for some PG attributes, such as enumerated types, the options will be pulled from PG, so need not be specified. For boolean types, the option should be convertable by PG, such as 't', 'true', 'y', 'yes', '1'.
publish_pgtype
If set, a percent encoded (AKA URL encoded) JSON object that describes that field is added as an HTML attribute named "pgtype".
expand_percent_n
For every field in a grid and for text array fields in onetable, the javascript event can be specified with %n in place of the index. For example in a grid, setting this and setting the onchange event to "change_status(%n, 'U')" will cause the first row to have the event "change_status(1,'U')", the second "change_status(2, 'U')", etc.
onfocus
onblur
onchange
onselect
onclick
ondblclick
onmousedown
onmouseup
onmouseover
onmousemove
onmouseout
onkeypress
onkeydown
onkeyup
Add a javascript action to the event. Quotes are escaped as necessary during document creation. Events can also be set JQuery style in javascript.