|
|
|
|
|
|
SubmitButton |
SubmitButton (
string |
$caption = "Submit", |
string |
$name = null, |
string |
$extra = null, |
boolean |
$disableOnSubmit = true |
) |
Arguments:
Name |
Description |
$caption |
The caption of the button. The default caption is "Submit", but this is language dependent. |
$name |
Name of the button. A name is generated if none is given. |
$extra |
This can be extra information which will be included in the buttons html tag. You can add for example some CSS or javascript. |
$disableOnSubmit |
Should the button being disabled after submitting the form? (This prevents double posting) |
Description:
Creates a submitbutton on the form.
Example
<?php
// include the class
include('FH3/class.FormHandler.php');
// create a new formhandler object
$form = new FormHandler();
// a textfield
$form -> textField("Name", "name", FH_STRING);
// submitbutton
$form -> submitButton();
// what to do when the form is correct?
$form -> onCorrect("doRun");
// flush the form
$form -> flush();
// the commit after form function
function doRun($data)
{
// do something here
echo "Hello " . $data['name'];
}
?>
|
Preview image
Latest change: 05 March 10 / 08:40
Comments
|
|
|
|