Login Retreive lost passwordRegister
Search

Manual  /  Functions  /  Look & Feel  /  IsViewMode

IsViewMode
IsViewMode ( )

Arguments:

Description:

This function checkes if viewMode is enabled or not for the whole form. You can enable or disable view mode with the function enableViewMode.

Note: To check if a specific field is set to viewMode you should use the function isFieldViewMode.

Example

<?php

// include FormHandler
include ('FH3/class.dbFormHandler.php' );

// create new dbformhandler object
$form = new dbFormHandler();

// set the database options
$form -> dbInfo'test''test' );
$form -> dbConnect'localhost','root''');

// enable view mode for the whole form when it's an edit form!
if( $form -> edit )
{
    
$form -> enableViewMode();
}

// field
$form -> textField("Your name""name" );

// submitbutton... only show when the form is not set to view mode!!!
if( !$form -> isViewMode() )
{
    
$form -> submitButton();
}

// what to do when the form is correct
$form -> onCorrect'doRun' );

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

// the function which is runned when the form is correct
function doRun$data )
{
    
// show the submitted data
    
echo "<pre>";
    
print_r$data );
    echo 
"</pre>";

}

?>

See also: EnableViewMode  |  IsViewMode  |  IsFieldViewMode

Latest change: 05 March 10 / 08:50

Comments

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