Login Retreive lost passwordRegister
Search

Manual  /  Functions  /  Look & Feel  /  NewPage

NewPage
NewPage ( )

This function is still beta!

Arguments:

Description:

Note: This function does not work with edit forms!!

This function will split your form up in multiple pages. Very easy to generate wizard-like forms.

Example

<?php 

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

// create a new form 
$form = new FormHandler(); 

//first page... 
$form -> textField("Question 1""q1"FH_STRING3050); 
$form -> submitButton("Next page"); 

// second page 
$form -> newPage(); 
$form -> textArea("Question 2""q2"FH_TEXT); 
$form -> submitButton("Next Page"); 

// third and last page 
$form -> newPage(); 
$form -> textField("Question 3""q3"FH_STRING); 
$form -> submitButton("Submit"); 

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

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

// data handler 
function doRun$data 

    echo 
"Data submitted:"
    echo 
"<pre>\n"
    
print_r$data ); 
    echo 
"</pre>\n";     


?>

Preview image

preview image

See also: BackButton

Latest change: 05 March 10 / 08:45

Comments

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