|
|
|
|
|
|
(Since version FH3 v1.2.7)
CaptchaField |
CaptchaField (
string |
$title |
string |
$name |
integer |
$size = 20, |
integer |
$maxlength = null, |
string |
$extra = null |
) |
Arguments:
Name |
Description |
$title |
Title of the field |
$name |
name of the field |
$size |
The size of the field |
$maxlength |
The maximum allowed characters in this field. 0 is interpretated as no limit. |
$extra |
This can be extra information which wull be included in the fields html tag. You can add for example some CSS or javascript. |
Description:
This function will create a captcha field and takes care of the validation.
Example
<?php
// include the class
include('FH3/class.FormHandler.php');
// make a new $oForm object
$oForm = new FormHandler();
// a textfield
$oForm->CaptchaField("Verify the code", "code");
// submitbutton beneath it
$oForm->submitButton("Save");
// set the 'commit after form' function
$oForm->onCorrect("FH_RUN");
// send the form to the screen
$oForm->flush();
// function to show a message
function FH_RUN($aData)
{
return "You entered the correct code ". $aData["code"];
}
?>
|
Preview image
Latest change: 11 July 11 / 09:25
Comments
|
|
|
|