Login Retreive lost passwordRegister
Search

Manual  /  Functions  /  Look & Feel  /  SetFieldViewMode

(Since version FH3-v1.2)

SetFieldViewMode
SetFieldViewMode (
string $field
boolean $mode = true 
)

Arguments:

Name Description
$field The field which you want to set to "ViewMode"
$mode Do you want to set the field to "ViewMode"?

Description:

With this function you can set a specific field to view mode. When a field is set to view mode, only the value is displayed.

Example

<?php

// include the formhandler
include( 'FH3/class.FormHandler.php' );

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

// add some fields
$form -> textField("Name""name"FH_STRING );

// username
$form -> textField("Username""username"FH_STRING );

// view mode for the username in edit mode
if( $form -> edit 
{
    
$form -> setFieldViewMode"username" );
}

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

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

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

// the function which is called when the form is correct
function doRun$data )
{
    echo 
"Hello "$data['name'];
}

?>

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