Public Method Details |
setJSMode |
|
public void setJSMode( [ string $js_mode ] )
|
| |
Sets the JavaScript validation mode.
|
| Parameter |
|
| string |
$js_mode |
= >>"weak"<< |
|
"weak" or "strong", if "strong" validation will be done onChange/onClick
otherwise only onSubmit. |
|
| Returns |
void |
|
setMethod |
|
public void setMethod( [ string $method ] )
|
| |
Sets the method used by this form.
|
| Parameter |
|
| string |
$method |
= >>"POST"<< |
|
"POST" or "GET" |
|
| Returns |
void |
| See Also |
autoloadValues(), $method |
|
autoloadValues |
|
public boolean autoloadValues( [ mixed $ellist ] )
|
| |
Loads the form with HTTP_[POST|GET]_VARS.
|
| Parameter |
|
| mixed |
$ellist |
= >>""<< |
|
of one element or array of elements. An empty string
causes a fallback to all elements. |
|
| Returns |
boolean |
|
setValues |
|
public boolean setValues( array $values )
|
| |
Sets the value of one element or a group of elements.
|
| Parameter |
|
| array |
$values |
|
|
of values, $values[ name ] = value |
|
| Returns |
boolean |
| Throws |
form_error |
|
ValidationOff |
|
public void ValidationOff( mixed $ellist )
|
| |
Public handle to turn default validation off.
|
| Parameter |
|
| mixed |
$ellist |
|
|
Name of one element or array of elements. |
|
| Returns |
void |
| See Also |
Validation() |
|
ValidationOn |
|
public void ValidationOn( mixed $ellist )
|
| |
Public handle to turn default validation on.
|
| Parameter |
|
| mixed |
$ellist |
|
|
Name of one element or array of elements. |
|
| Returns |
void |
| See Also |
Validation() |
|
getStart |
|
public string getStart( [ string $js_name, string $method, string $action, string $target ] )
|
| |
Generates the opening HTML form tag, <form>.
|
| Parameter |
|
| string |
$js_name |
= >>""<< |
|
form name. If empty no JavaScript validation will be done. |
|
|
| string |
$method |
= >>"POST"<< |
|
method attribute: "POST" or "GET". |
|
|
| string |
$action |
= >>""<< |
|
action attribute. If empty $PHP_SELF gets used. |
|
|
| string |
$target |
= >>""<< |
|
target attribute. |
|
| Returns |
string HTML form-Tag |
| Required global variables |
|
|
|
Start |
|
public void Start( [ string $js_name, string $method, string $action, string $target ] )
|
| |
Generate and print <form>-Tag
|
| Parameter |
|
| string |
$js_name |
= >>""<< |
|
form name. If empty no JavaScript validation will be done. |
|
|
| string |
$method |
= >>"POST"<< |
|
method attribute: "POST" or "GET". |
|
|
| string |
$action |
= >>""<< |
|
action attribute. If empty $PHP_SELF gets used. |
|
|
| string |
$target |
= >>""<< |
|
target attribute. |
|
| Returns |
void |
| Required global variables |
|
|
|
getFinish |
|
public string getFinish( [ string $additional_html, mixed $sess ] )
|
| |
Generates the closing HTML form tag and handles the hidden elements.
|
| Parameter |
|
| string |
$additional_html |
= >>""<< |
|
Optional, additional HTML inserted in front of
the generated HTML. |
|
|
| mixed |
$sess |
= >>""<< |
|
Session Class |
|
| Returns |
string $html |
|
Finish |
|
public void Finish( [ string $additional_html, mixed $sess ] )
|
| |
Generate and print closing </form>-Tag.
|
| Parameter |
|
| string |
$additional_html |
= >>""<< |
|
Optional, additional HTML inserted in front of
the generated HTML. |
|
|
| mixed |
$sess |
= >>""<< |
|
Session Class |
|
| Returns |
void |
|
get |
|
public string get( [ string $js_name, string $method, string $action, string $target, string $additional_html ] )
|
| |
Generate the complete form.
|
| Parameter |
|
| string |
$js_name |
= >>""<< |
|
form name. If empty no JavaScript validation will be done. |
|
|
| string |
$method |
= >>"POST"<< |
|
method attribute: "POST" or "GET". |
|
|
| string |
$action |
= >>""<< |
|
action attribute. If empty $PHP_SELF gets used. |
|
|
| string |
$target |
= >>""<< |
|
target attribute. |
|
|
| string |
$additional_html |
= >>""<< |
|
HTML added right before the closing form-Tag |
|
| Returns |
string HTML form-Tag |
| Required global variables |
|
|
| See Also |
getStart(), getFinish() |
|
show |
|
public void show( [ string $js_name, string $method, string $action, string $target, string $additional_html ] )
|
| |
Generate and print the complete form.
|
| Parameter |
|
| string |
$js_name |
= >>""<< |
|
form name. If empty no JavaScript validation will be done. |
|
|
| string |
$method |
= >>"POST"<< |
|
method attribute: "POST" or "GET". |
|
|
| string |
$action |
= >>""<< |
|
action attribute. If empty $PHP_SELF gets used. |
|
|
| string |
$target |
= >>""<< |
|
target attribute. |
|
|
| string |
$additional_html |
= >>""<< |
|
HTML added right before the closing form-Tag |
|
| Returns |
void |
| Required global variables |
|
|
| See Also |
getStart(), getFinish() |
|
addElement |
|
public bool addElement( array $element_data )
|
| |
Adds an element to the form object.
|
| Parameter |
|
|
| Returns |
bool $ok |
| Throws |
form_error |
|
getElement |
|
public string getElement( string $elname, [ string $value ] )
|
| |
Generate and return the html representation of an element.
|
| Parameter |
|
|
|
| string |
$value |
= >>""<< |
|
value, only used with radio - FIXME |
|
| Returns |
string HTML |
| Throws |
form_error |
|
getType |
|
public string getType( string $elname )
|
| |
Return the type of an element.
|
| Parameter |
|
|
| Returns |
string $type |
| Throws |
form_error |
|
getValue |
|
public mixed getValue( string $name )
|
| |
Return the current value of an element.
Use the function within your custom validation functions.
|
| Parameter |
|
| string |
$name |
|
|
element name |
|
| Returns |
mixed $value |
| Throws |
form_error |
|
validate |
|
public array validate( [ mixed $vallist ] )
|
| |
Validate a form.
|
| Parameter |
|
|
| Returns |
array ($error_msg, $error_flags) |
|
setValidationError |
|
public boolean setValidationError( string $name, string $message )
|
| |
Sets the validation error message for of an element.
|
| Parameter |
|
| string |
$name |
|
|
element name |
|
|
|
| Returns |
boolean $ok |
| Throws |
form_error |
| See Also |
getValidationResult(), validate() |
|
getValidationResult |
|
public array getValidationResult( )
|
| |
Returns an array that holds the results of the last validation.
|
| Returns |
array ($error_msg, $error_flags) |
| See Also |
setValidationError(), validate() |
|
freeze |
|
public void freeze( [ mixed $flist ] )
|
| |
Freeze an element, frozen elements are drawn in an non editable way.
A user can't change the value of an frozen element.
|
| Parameter |
|
|
| Returns |
void |
|
unfreeze |
|
public void unfreeze( [ mixed $flist ] )
|
| |
Thaw out an element.
|
| Parameter |
|
| mixed |
$flist |
= >>""<< |
|
of one element or list of elements to unfreeze. An empty
string causes a fallback to all elements. |
|
| Returns |
void |
| See Also |
freeze() |
|
addJS |
|
public bool addJS( string $name, string $code )
|
| |
Adds JavaScript validation code to an element
FIXME
|
| Parameter |
|
| string |
$name |
|
|
name of the element |
|
|
| string |
$code |
|
|
JavaScript code |
|
| Returns |
bool $ok |
| Throws |
form_error |
|
getJS |
|
public string getJS( )
|
| |
Returns JavaScript validation code.
|
| Returns |
string $code JavaScript validation code |
| Throws |
form_error |
|
getElements |
|
public array getElements( )
|
| |
Returns an array of all elements.
|
| Returns |
array $elements [ name ] = name |
|
getOptions |
|
public array getOptions( mixed $ellist )
|
| |
Return an array of all options of a combo list.
Comboboxes expand their option list. Take care that you savethe expanded option list so that you can reload the newoption list after the form was submittet.FIXME getOptions()
|
| Parameter |
|
| mixed |
$ellist |
|
|
String with the name of one element or a list of elements. |
|
| Returns |
array $options |
| Throws |
form_error |
|
getSessionHash |
|
public array getSessionHash( )
|
| |
FIXME
Returns an array with elname => value pairs, that can be usedto be stored in a session. new_assistant needs this
|
| Returns |
array $session_hash |
|
isChecked |
|
public boolean isChecked( string $elname )
|
| |
Is this checkboxobject checked?
|
| Parameter |
|
|
| Returns |
boolean |
|
getNewComboOption |
|
public string getNewComboOption( string $name )
|
| |
Returns the latest combo entry of the user
|
| Parameter |
|
| string |
$name |
|
|
element name |
|
| Returns |
string $html |
|
addOption |
|
public bool addOption( string $name, string $label, [ string $value ] )
|
| |
Add a new option to a combo
|
| Parameter |
|
|
|
|
|
| string |
$value |
= >>""<< |
|
= "" |
|
| Returns |
bool $ok |
| See Also |
getNewComboOption(), SetOptions(), getOptions() |
|
getTree |
|
public array getTree( string $ellist )
|
| |
FIXME FIXME
Returns the tree for a certain value of an treeview elementIt's just implementet to make the api complete
|
| Parameter |
|
| string |
$ellist |
|
|
|array $ellist |
|
| Returns |
array $trees |
|
setTree |
|
public bool setTree( array $ellist )
|
| |
Set the tree of an treeview element
Helpful with dynamically changing trees
|
| Parameter |
|
|
| Returns |
bool $ok |
| Throws |
form_error |
|
setJSError |
|
public void setJSError( string $prefix, string $postfix )
|
| |
Sets the JavaScript error message pre- and postfix text.
|
| Parameter |
|
|
|
|
| Returns |
void |
| See Also |
$js_error_prefix, $js_error_postfix |
|