Login Retreive lost passwordRegister
Search

Manual  /  Functions  /  Look & Feel  /  AddLine

AddLine
AddLine (
string $text
)

Arguments:

Name Description
$text The text you want to display.

Description:

This function adds a line (a new row) into the form table. There is one argument: $text. When some text is given, this is inserted into the line.

Note: The look of the line can be changed in the configuration file.

Example

<?php 

// include the class 
include("FH3/class.FormHandler.php"); 

// create new formhandler object 
$form = new FormHandler(); 

// star for required fields 
$star = ' <font color="red">*</font>'; 

// some fields 
$form -> textField("Name".$star, "name", FH_STRING, 20, 50); 
$form -> textField("Age".$star, "age", FH_INTEGER, 3, 2); 

// add a line that every field with a red * is required 
$form -> addLine($star ."  = Required fields"); 

// button to submit the form 
$form -> submitButton(); 

// set the data handler 
$form -> onCorrect("doRun"); 

// display the form 
$form -> flush(); 

// the data handler 
function doRun( $data )  
{ 
    echo 
    "Hello ". $data["name"].",\n". 
    "You are ". $data["age"] ." years old.\n"; 
} 
?>

Preview image

preview image

Latest change: 05 March 10 / 08:43

Comments

powered by PHP-GLOBE   © 2004 - 2026 FormHandler. All rights reserved.   -   Open source license