Formdoid

Advance PHP DB Form Builder


Formdoid is advance PHP database form builder that generates the form directly from the database tables by writing 2-3 lines of codes only.

Start Here

Start Here

function dbTable($tableName)
                

Set table name for which form needs to be generated


Parameter Name Type Description
$tableName string The name of the table to generate form.

 

function formTag($formHeading = "", $formType = "", $class = array(), $attr = array())
                

Set table name for which form needs to be generated


Parameter Name Type Description
$formHeading string fields
$formType string  
$class string  
$attr string  
  object return

 

function formFields($fields)
                

Set table name for which form needs to be generated


Parameter Name Type Description
$fields array Form fields to displayed only.
  object return

 

function formRemoveFields($fields = array())
                

Removes specific fields from from


Parameter Name Type Description
$fields array Form fields to displayed only.
  object return

 

function formSetPrimarykey($pk, $pkval)
                

Set primary key and value for update form


Parameter Name Type Description
$pk string From email
$pkval string To email
  object return

 

function formExportData($exportType = "pdf")
                

Export related settings, instead of inserting data in database, you can directly export it to PDF, CSV, Excel and XML


Parameter Name Type Description
$exportType string From email
  object return

 

function formAddCaptcha($fieldName)
                

Add captcha in form


Parameter Name Type Description
$fieldName string Name of field for captcha
  object return

 

function formDisplayInPopup($buttonContent = "", $headerContent = "")
                

Display form in popup on click on some button


Parameter Name Type Description
$buttonContent string From email
$headerContent string To email
  object return

 

function formId($id)
                

Sets ID of Form


Parameter Name Type Description
$id string ID of the form
  object return

 

function fieldDisplayOrder($fields)
                

Change display order of the fields


Parameter Name Type Description
$fields array fields in ascending order to be displayed in form
  object return

 

function fieldCssClass($fieldName, $fieldClass = array())
                

Set specific css class to the different fields


Parameter Name Type Description
$fieldName string field name for which css class name needs to be applied
$fieldCssClass array css class name for the field
  object return

 

  public function formStaticFields($fieldName, $fieldType, $fieldValue = "")
                

Add static fields to the form


Parameter Name Type Description
$fieldName string name of static field
$fieldType string type of field, e.g. radio, checkbox etc
$fieldValue string Value of the field
  object return

 

function fieldRenameLable($fieldName, $lableName)
                

Rename the field label name


Parameter Name Type Description
$fieldName string field name for which lable name needs to be changed
$lableName string lable name to be set
  object return

 

function fieldHideLable($fieldName, $takeSpace = false)
                

Hide the field label name


Parameter Name Type Description
$fieldName string field name for label needs to be hidden
$takeSpace bool whether hidden lable should take space or not
  object return

 

function buttonHide($buttonname="cancel")
                

Hide the cancel button


Parameter Name Type Description
$fieldName string field name for label needs to be hidden
$takeSpace bool whether hidden lable should take space or not
  object return

 

function fieldNotMandatory($fieldName)
                

Removes required attribute from fields


Parameter Name Type Description
$fieldName string field name for which required attribute needs to be removed
  object return

 

function fieldAttributes($fieldName, $attr = array())
                

Sets the data attribute of field


Parameter Name Type Description
$fieldName string field name for attribute needs to set
$attr array Array of data attributes with key as attribute name and value as attribute value
  object return

 

function fieldAttributes($fieldName, $attr = array())
                

Sets the data attribute of field


Parameter Name Type Description
$fieldName string field name for attribute needs to set
$type string Array of data attributes with key as attribute name and value as attribute value
$parameters string Array of data attributes with key as attribute name and value as attribute value
  object return

 

 function fieldValidationType($fieldName, $validation, $param = "true", $errorMsg = "")
                

Sets the validation require for the field


Parameter Name Type Description
$fieldName string field name for validation needs to be set
$validation string validation like required, email etc
$param string value of validation, default is true
  object return

 

function fieldDependent($dependent, $dependOn, $colName)
                

Sets the data attribute of field


Parameter Name Type Description
$dependent string field name to be changed on onchange operation of dependOn field
$dependOn string field that change will cause trigger change
$colName string name of col, needs to be retrived to change the field value
  object return

 

function fieldDataBinding($fieldName, $dataSource, $key, $val, $bind = "db")
                

Sets data binding of the field i.e. load the field data from some datasource


Parameter Name Type Description
$fieldName string field name to be bind
$dataSource string data source either tablename or array of data
$key string name of col, that will serve as data key
$val string name of col, that will serve as field valye
$bind string whether datasource is db table or array, default is db table
  object return

 

          function fieldAddOnInfo($fieldName, $position, $addOnText)
                

Sets input addon information for the bootstrap


Parameter Name Type Description
$fieldName string field name to be bind
$position string data source either tablename or array of data
$addOnText string name of col, that will serve as data key
  object return

 

                function fieldBlockClass($fieldName, $class)
                

Sets the class of complete input block inside a bootstrap form-group class


Parameter Name Type Description
$fieldName string field name to be bind
$class string data source either tablename or array of data
  object return

 

               function fieldGroups($groupName, $fields = array()) 
                

Sets data binding of the field i.e. load the field data from some datasource


Parameter Name Type Description
$groupName string Any unuique name of group e.g. full_name
$fields array array of fields like array(first_name, last_name)
  object return

 

               function FormSteps(array $fields, $stepName, $stepType = "stepy", $attr = array())
                

Divide form fields into various steps/tabs


Parameter Name Type Description
$fields array Any unuique name of group e.g. full_name
$stepName string array of fields like array(first_name, last_name)
$stepType string array of fields like array(first_name, last_name)
$attr string array of fields like array(first_name, last_name)
  object return

 

        function fieldTooltip($fieldName, $tooltip, $tooltipIcon = "")
                

Tooltip for the field


Parameter Name Type Description
$fieldName array Any unuique name of group e.g. full_name
$tooltip string array of fields like array(first_name, last_name)
$tooltipIcon string array of fields like array(first_name, last_name)
  object return

 

        function fieldTooltip($fieldName, $tooltip, $tooltipIcon = "")
                

Tooltip for the field


Parameter Name Type Description
$fieldName array Any unuique name of group e.g. full_name
$tooltip string array of fields like array(first_name, last_name)
$tooltipIcon string array of fields like array(first_name, last_name)
  object return

 

                function fieldDesc($fieldName, $desc)
                

Set description of the field


Parameter Name Type Description
$fieldName string Any unuique name of group e.g. full_name
$desc string array of fields like array(first_name, last_name)
  object return

 

                function fieldDesc($fieldName, $desc)
                

Description:Add some html content in the form (normally added at the end of form)


Parameter Name Type Description
$html string Any unuique name of group e.g. full_name
  object return

 

               function outputHTMLContent($output = true)
                

Description Output html content and clears html content, can be called at specific places to output content


Parameter Name Type Description
$output bool Any unuique name of group e.g. full_name
  object return

 

                 function addPlugin($pluginName)
                

Add js/css based plugin, plugin needs to be placed inside plugins folder with js files under js folder and css files under css folder


Parameter Name Type Description
$pluginName string Name of the plugin to be added, make sure plugins folder is readable
  object return

 

                 function addPlugin($pluginName)
                

Add js/css based plugin, plugin needs to be placed inside plugins folder with js files under js folder and css files under css folder


Parameter Name Type Description
$pluginName string Name of the plugin to be added, make sure plugins folder is readable
  object return

 

                function enqueueJs($jsName, $jsPath)
                

Add javascript by specify js name and path of js, it will be loaded with other scripts


Parameter Name Type Description
$jsName string Name of javascript to be loaded
$jsPath string Path of javascript to be loaded
  object return

 

                function applyJS($applyOn, $applyOnVal, $functionName, $action = "on_form_load", $options = array())
                

Add directly javascript


Parameter Name Type Description
$applyOn string Name of javascript to be loaded
$applyOnVal string Path of javascript to be loaded
$functionName string Path of javascript to be loaded
$action string Path of javascript to be loaded
$options string Path of javascript to be loaded
  object return

 

               function unsetJs($jsName)
                

Removes already enqueue js, useful for removing js that are already included in your page


Parameter Name Type Description
$jsName string Name of javascript to be removed
  object return

 

               function outputJs($output = true)
                

Output js


Parameter Name Type Description
$output bool if true output the content else return the content.
  object return

 

               function outputApplyJs($output = true)
                

Output javascript added using the apply js


Parameter Name Type Description
$output bool if true output the content else return the content.
  object return

 

              function addCallback($eventName, $callback)
                

Add callback function to be called on certain event


Parameter Name Type Description
$eventName string if true output the content else return the content.
$callback string if true output the content else return the content.
  object return

 

         function loadPluginJsCode($pluginName, $elementName, $params = array())
                

Loads plugin js code, must be called after render function


Parameter Name Type Description
$pluginName string Name of plugin
$elementName string Element name for which plugin needs to be called
$params string list of parameters/options for the plugin js code
  string String of js code

 

                  function enqueueCss($cssName, $cssPath)
                

Add css by specify css name and path of css, it will be loaded with other css


Parameter Name Type Description
$cssName string Name of plugin
$cssPath string Element name for which plugin needs to be called
  object return

 

                  function unsetCss($cssName)
                

Removes already enqueue css, useful for removing css that are already included in your page


Parameter Name Type Description
$cssName string Name of plugin
  object return

 

                  function outputCss($output = true)
                

Output css


Parameter Name Type Description
$output bool if true output the content else return the content.
  object return

 

                 function setCurrentLang($lang)
                

Set current language


Parameter Name Type Description
$lang string language to be used
  object return

 

                 function getLangData($param)
                

Return language data


Parameter Name Type Description
$param string language to be used
  object return

 

                 function setLangData($param, $val)
                

Return language data


Parameter Name Type Description
$key string lanuguage key for which data needs to save
$val string Value for the language parameter
  object return

 

               function getErrors()
                

Return errors


Parameter Name Type Description
return array

 

Formdoid - An Advance Form Builder PHP Application


Heading Value Description
script_url http://localhost/formdoid/ script url - enter complete url inside which script folder is placed
hostname localhost Set the host name to connect for data
database formdoid Set the database name
username formdoid Set the username for database access
password Set the password for the database user
dbtype mysql Set the database type to be used
characterset utf8 Set the characterset type to be used
salt @3dsfsdf**9934324 Encryption and Decryption salt
template bootstrap template
required true required
lang en default langugae
uploadFolder FormdoidABSPATH . "uploads/" Upload folder
uploadURL $config["script_url"] . "script/uploads/ Upload folder URL
downloadFolder FormdoidABSPATH . "downloads/ download folder
downloadURL $config["script_url"] . "script/downloads/ Download folder URL
dateformat yy-mm-dd date format
timeformat HH:mm:ss time format
hideAutoIncrement true hide auto increment field
blockClass array("col-xs-10", "col-sm-10", "col-lg-10") block css settings
lableClass array("col-xs-2", "col-sm-2", "col-lg-2") block label settings
hideLable false hide all lables
hideHTMLLable true hide lable of field type html
loadJs array("jquery.min.js","jquery-ui.min.js","jquery.form.js","jquery-ui-timepicker-addon.js","validator.js","jquery.stepy.js"); load js initially (this js needs to be present in script/js fodler)
loadCss array("style.css","jquery-ui.css","jquery-ui-timepicker-addon.css") load css initially (this css needs to be present in script/css fodler)
loadJsPlugins array("icheck") load plugins initially (list of plugins available)
displayErrors true display errors directly
submissionType "ajax" submit whether using ajax or using simple post
jsvalidation "bootstrap_validator" enable js validation
phpvalidation true enable php validation
emailMode "PHPMAIL"
SMTPHost "ajax"
SMTPPort 25
SMTPAuth true
SMTPusername ""
SMTPpassword ""
SMTPSecure ""
SMTPKeepAlive true