tce__functions__form_8php

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.
tce_functions_form.php File Reference

Namespaces

 com\tecnick\tcexam\shared
 TCExam Shared Area.
 

Functions

if(isset($_POST[‘update’])) elseif(isset($_POST[‘delete’])) elseif(isset($_POST[‘forcedelete’])) elseif(isset($_POST[‘cancel’])) elseif(isset($_POST[‘add’])) elseif(isset($_POST[‘clear’])) elseif(isset($_POST[‘upload’])) elseif(isset($_POST[‘addquestion’])) if(!isset($menu_mode)) F_decode_form_fields ()
 
 F_check_required_fields ($formfields)
 
 F_check_fields_format ($formfields)
 
 F_check_form_fields ()
 
 F_stripslashes_formfields ()
 
 F_close_button ($onclick=“)
 
 F_submit_button ($name, $value, $title="")
 
 getFormRowTextInput ($field_name, $name, $description=“, $tip=”, $value=“, $format=”, $maxlen=255, $date=false, $datetime=false, $password=false, $prefix=“)
 
 getFormRowTextBox ($field_name, $name, $description=“, $value=”, $disabled=false, $prefix=“)
 
 getFormRowSelectBox ($field_name, $name, $description=“, $tip=”, $value=“, $items=array(), $prefix=”)
 
 getFormRowCheckBox ($field_name, $name, $description=“, $tip=”, $value=“, $selected=false, $disabled=false, $prefix=”)
 
 getFormRowFixedValue ($field_name, $name, $description=“, $tip=”, $value=“, $currency=false, $prefix=”)
 
 getFormSmallVertSpace ()
 
 getFormSmallDivSpace ()
 
 getFormRowVertSpace ()
 
 getFormRowVertDiv ($title=“)
 
 getFormNoscriptSelect ($name=‘selectrecord’)
 
 getFormDescriptionLine ($name, $description=“, $value=”)
 
 getFormUploadFile ($field_name, $field_id, $name, $description=“, $onchange=”)
 

Variables

 $formstatus = TRUE
 

Detailed Description

Functions to handle XHTML Form Fields.

Function Documentation

F_check_fieldsformat (   $formfields)

Check fields format using regular expression comparisons.
Returns a string containing a list of wrong fields (comma separated).

NOTE: to check a field create a new hidden field with the same name starting with ‘x‘

An example powerful regular expression for email check is: ^([a-zA-Z0-9_.-]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$

Parameters
$formfields(string) input array containing form fields
Returns
array containing a list of wrongfields (if any)

F_check_form_fields ( )

Check Form Fields. see: F_check_required_fields, F_check_fields_format

Returns
false in case of error, true otherwise

F_check_required_fields (   $formfields)

Check Required Form Fields.
Returns a string containing a list of missing fields (comma separated).

Parameters
$formfields(string) input array containing form fields
Returns
array containing a list of missing fields (if any)

F_close_button (   $onclick = )

Returns XHTML code string to display a window close button

Parameters
$onclick(string) additional javascript code to execute before closing the window.
Returns
XHTML code string

if (isset($_POST[‘update’])) elseif (isset($_POST[‘delete’])) elseif (isset($_POST[‘forcedelete’])) elseif (isset($_POST[‘cancel’])) elseif (isset($_POST[‘add’])) elseif (isset($_POST[‘clear’])) elseif (isset($_POST[‘upload’])) elseif (isset($_POST[‘addquestion’])) if (!isset($menu_mode)) F_decode_form_fields ( )

Returns an array containing form fields.

Returns
array containing form fields

F_stripslashes_formfields ( )

Strip slashes from posted form fields.

F_submit_button (   $name,
  $value,
  $title = "" 
)

Returns XHTML code string to display Form Submit Button.

Parameters
$name(string) button name
$value(string) label for button
$title(string) button title, default=“”
Returns
XHTML code string

getFormDescriptionLine (   $name,
  $description = ,
  $value =  
)

Print form row with label and description

Parameters
$name(string) Label.
$description(string) Label description (tooltip).
$value(string) Initial value.
Returns
string

getFormNoscriptSelect (   $name = ‘selectrecord’)

Print form row with submit button when noscript is active.

Parameters
$name(string) Name of the input form field.
Returns
string

getFormRowCheckBox (   $field_name,
  $name,
  $description = ,
  $tip = ,
  $value = ,
  $selected = false,
  $disabled = false,
  $prefix =  
)

Print check box row form.

Parameters
$field_name(string) Name of the form field.
$name(string) Label.
$description(string) Label description (tooltip).
$tip(string) Help to be displayed on the right of the input field.
$value(string) Initial value.
$selected(boolean) set to true if selected.
$disabled(boolean) set to true to disable the field
$prefix(string) code to be displayed after label.
Returns
string

getFormRowFixedValue (   $field_name,
  $name,
  $description = ,
  $tip = ,
  $value = ,
  $currency = false,
  $prefix =  
)

Print fixed value row form.

Parameters
$field_name(string) Name of the form field.
$name(string) Label.
$description(string) Label description (tooltip).
$tip(string) Help to be displayed on the right of the input field.
$value(string) Initial value.
$currency(boolean) if true the value is a curency number.
$prefix(string) code to be displayed after label.
Returns
string

getFormRowSelectBox (   $field_name,
  $name,
  $description = ,
  $tip = ,
  $value = ,
  $items = array(),
  $prefix =  
)

Print select box row form.

Parameters
$field_name(string) Name of the form field.
$name(string) Label.
$description(string) Label description (tooltip).
$tip(string) Help to be displayed on the right of the input field.
$value(string) Initial value.
$items(array) array of items to print key => value.
$prefix(string) code to be displayed after label.
Returns
string

getFormRowTextBox (   $field_name,
  $name,
  $description = ,
  $value = ,
  $disabled = false,
  $prefix =  
)

Print text box row form.

Parameters
$field_name(string) Name of the form field.
$name(string) Label.
$description(string) Label description (tooltip).
$value(string) Initial value.
$disabled(boolean) If true disable the field.
$prefix(string) code to be displayed after label.
Returns
string

getFormRowTextInput (   $field_name,
  $name,
  $description = ,
  $tip = ,
  $value = ,
  $format = ,
  $maxlen = 255,
  $date = false,
  $datetime = false,
  $password = false,
  $prefix =  
)

Print input row form.

Parameters
$field_name(string) Name of the form field.
$name(string) Label.
$description(string) Label description (tooltip).
$tip(string) Help to be displayed on the right of the input field.
$value(string) Initial value.
$format(string) Regular expression to check the format of the field.
$maxlen(int) Maximum input lenght.
$date(boolean) True if the field is a date input.
$datetime(boolean) True if the field is a date-time input.
$password(boolean) True if the field is a password.
$prefix(string) code to be displayed after label.
Returns
string

getFormRowVertDiv (   $title = )

Print form row with title.

Parameters
$title(string) Title to be printed.
Returns
string

getFormRowVertSpace ( )

Print empty form row.

Returns
string

getFormSmallDivSpace ( )

Print empty form row.

Returns
string

getFormSmallVertSpace ( )

Print empty form row.

Returns
string

getFormUploadFile (   $field_name,
  $field_id,
  $name,
  $description = ,
  $onchange =  
)

Print input row form to upluad a file.

Parameters
$field_name(string) Name of the form field.
$field_id(string) ID of the form field.
$name(string) Label.
$description(string) Label description (tooltip).
$onchange(string) Javascript code to execute at onchange event.
Returns
string

Variable Documentation

$formstatus = TRUE

 

© 2004-2017 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy