====== Default Field types ====== Below is a list of the available default Radria field types. In context form, all of the registry fields generate HTML Form fields and are set with the default “class=adformfield” Included is a detailed list of all field types and how they are used. ===== One Line text ===== * Radria fieldtype: strFBFieldTypeChar * SQL Type: varchar * rdata (options): fieldtype, default, hidden, readonly, label, textline, ordering, dispalign, disabled, execute, substring * In Form Context: Generates an HTML input text field that takes varchar input. * In Disp Context: Display the content of a varchar field. * Usage of rdata textline: {display size in characters}:{maximum number of characters for input} Example: 1 Your Name First Name 10:30 strFBFieldTypeChar varchar ===== Check Box ===== * Radria fieldtype: strFBFieldTypeCheckBox * SQL Type: varchar * rdata (options): checked_value, fieldtype, default, hidden, readonly, label, checkbox, ordering, dispalign * In Form Context: Generates HTML for an input field type checkbox and sets the value to the content of the rdata checked_value. If the value of the field equals the value in the checked_value rdata then the checkbox is displayed as checked. * In Context Disp: Displays the content of the varchar field. Exemple: Yes Yes Do you accept the terms strFBFieldTypeCheckBox 1 varchar ===== Email ===== * Radria fieldtype: strFBFieldTypeEmail * SQL Type: varchar * rdata (options): fieldtype, default, hidden, readonly, label, email, textline, ordering, dispalign, disabled, execute * In Form Context: Generates an HTML input text field and adds the event-action mydb.checkEmail that verifies if the domain name for that email address exists. * In Context Disp: Displays an email address in an HTML link with mailto. Example: 1 Email field 20:40 strFBFieldTypeEmail varchar ===== File ===== * Radria fieldtype: strFBFieldTypeFile * SQLType: varchar * rdata (options): fieldtype, default, hidden, readonly, label, picture, showpicture, ordering, dispalign, execute, overwrite * In Form Context: Generates an HTML File field and adds the event-action mydb.formatPictureField to manage the uploaded file. The name of the file uploaded will be stored in the database field. By default when 2 files with the same name are uploaded the second one will overwrite the first. To avoid that you can set the rdata: overwrite to no. * In Disp Context: If you have set the rdata showpicture to 1 it will generate the HTML to display the image. (), otherwise it will display the content of the varchar field. * Usage of rdata picture: {directory name} * Usage of rdata showpicture: {boolean 0 or 1} Example: Picture of the product dbimage 1 no strFBFieldTypeFile varchar This example will upload files to the dbimage directory. ===== Float Number ===== * Radria fieldtype: strFBFieldTypeFloat * SQL Type: Float * rdata (options): fieldtype, default, hidden, readonly, label, textline, ordering, dispalign, numberformat, disabled * In Form Context: This field type extends the strFBFieldTypeChar (one line of text). It behaves identically. * In Disp Context: Displays the content of the float field. Example: distance in miles 5:10 strFBFieldTypeFloat float ===== Integer Number ===== * Radria fieldtype: strFBFieldTypeInt * SQL Type: integer * rdata (options): fieldtype, default, hidden, readonly, label, textline, ordering, dispalign, numberformat, disabled * In Form Context: This field type extends the strFBFieldTypeChar (one line of text). It behaves identically. * In Disp Context: Displays the content of the Int field. Example: 28 integer 2:2 strFBFieldTypeInt integer ===== List Box ===== * Radria fieldtype: strFBFieldTypeListBox * SQL Type: varchar * rdata (options): fieldtype, default, hidden, readonly, label, list, emptydefault, ordering, dispalign * In Form Context: Generates the HTML to display a select field. The rdata type “list” specifies the name of a table from which to get the select box options. If you provide a sqlSavedQuery name it will execute that query instead of the previous parameters to display the content of the list box. The first field returned by the sqlSavedQuery will be the one inserted in the table. * In Disp Context: Gets the list values to display from another table using the rdata list. * Usage of rdata list: {table name}:{field name to insert in current field}:{field name to display}:{default value}:{ sqlSavedQuery name} Example: states:shortname:fullname:0: States strFBFieldTypeListBox ===== List Box of Files ===== * Radria fieldtype: strFBFieldTypeListBoxFile * SQL Type: varchar * rdata (options): fieldtype, default, hidden, readonly, label, listfile, ordering, dispalign * In Form Context: Generates the HTML to display a select field. It uses the rdata type “list” to specify a directory from which to get the select box options. If you provide a file extension it will show only those files. * In Disp Context: Displays the content of the varchar field. * Usage of rdata listfile: {directory path}:{file extension}:{default value} Example: ./:.inc.php: strFBFieldTypeListBoxFile varchar ===== List Box Small ===== * Radria fieldtype: strFBFieldTypeListBoxSmall * SQL Type: varchar * rdata (options): fieldtype, default, hidden, readonly, label, listvalues, listlabels, ordering, dispalign, emptydefault. * In Form Context: Generates the HTML to display a select field. It uses the rdata type “listvalues” and “listlabels” for the content of the select box. This type is usefull for small list boxes. * In Disp Context: Displays the content of the varchar field. * Usage of rdata listfile: {value1}:{value2}:{value3} {label1}:{label2}:{label3} Example: D:W:M:Y Day:Week:Month:Year strFBFieldTypeListBoxSmall varchar no ===== Login ===== * Radria fieldtype: strFBFieldTypeLogin * SQL Type: varchar * rdata (options): fieldtype, default, hidden, readonly, label, access, ordering, dispalign, execute * In Form Context: Generates an HTML input text field and adds the event-action mydb.checkUsernamePassword that verifies that the value entered doesn't match a username already in the current table. * In Disp Context: Displays the content of the varchar field. * Usage of rdata access: {string login or password} Example: Username login 20:40 strFBFieldTypeLogin varchar ===== Password ===== * Radria fieldtype: strFBFieldTypePassword * SQL Type: varchar * rdata (options): fieldtype, default, hidden, readonly, label, access, ordering, dispalign, execute * In Form Context: Generates the HTML for two input pasword fields, and adds the event-action mydb.checkUsernamePassword that verifies that both password values are identical. * In Disp Context: Displays the content of the varchar field. * Usage of rdata access: {string login or password} Example: Password password strFBFieldTypePassword varchar ===== Radio Buttons ===== * Radria fieldtype: strFBFieldTypeRadioButton * SQL Type: varchar * rdata (options): fieldtype, default, hidden, readonly, label, radiobutton, ordering, dispalign * In Form Context: Generates the HTML to display a list of radio button fields. It uses the rdata radiobutton to get the radio button field values and labels from another field and display them. * In Disp Context: Gets the value to display from another table using the rdata radiobutton. * Usage of rdata radiobutton: {table name}:{table field name to display}:{table field name to insert in current field}:{default value} Example: Select one answer strFBFieldTypeRadioButton answers:idanswers:description: varchar ===== Radio Buttons Small ===== * Radria fieldtype: strFBFieldTypeRadioButtonSmall * SQL Type: varchar * rdata (options): fieldtype, default, hidden, readonly, label, radiovalues, radiolabels, ordering, dispalign, vertical * In Form Context: Generates the HTML to display a list of radio buttons. It uses the rdata type “radiovalues” and “radiolabels” for the content of the radio buttons. This type is useful for small radio button lists. * In Disp Context: Displays the content of the varchar field. * Usage of rdata listfile: {value1}:{value2}:{value3} {label1}:{label2}:{label3} Example: M:F Male:Female strFBFieldTypeRadioButtonSmall varchar ===== MultilineText (Text Area) ===== * Radria fieldtype: strFBFieldTypeText * SQL Type: text * rdata (options): default, hidden, readonly, label, textarea, html, ordering, dispalign, disabled, execute, substring * In Form Context: The text area will generate the HTML code to create a textarea field. If there is a label in the rdata htmleditor a link to the htmleditor is displayed (required in the htmleditor package). * In Disp Context: Displays the content of the text field. If rdata html is set to 1 all of the HTML code will be displayed. * Usage of rdata textarea: {cols}:{lines}:{wrap} Example: Your Comments 50 50:10: 1 strFBFieldTypeText Click here to open the HTMLEditor text ===== unix Date ===== * Radria fieldtype: strFBFieldTypeDate * SQL Type: integer * rdata (options): default, hidden, readonly, label, datef, ordering, dispalign * In Form Context: Generates 3 HTML input text fields: Days, Months and Years. Years are 4 characters long. The order of the fields can be set with the rdata datef. Add the event-action mydb.formatDateField that will convert the values to a unix time stamp. * In Disp Context: Translates the unix time stamp to the date format set in the rdata datef. * Usage of rdata datef: {date format m, d, Y separated with / or -}:{string for default value (today):{boolean 1 or 0 to hide the field} Example: Document creation date m/d/Y:today: strfFBFieldTypeDate integer ===== SQL Date ===== * Radria fieldtype: strFBFieldTypeDateSQL * SQL Type: date * rdata (options): default, hidden, readonly, label, datesql, ordering, dispalign * In Form Context: Generates 3 HTML input text fields: Days, Months and Years. Years are 4 characters long. The order of the fields can be set with the rdata datesql. It adds the event-action mydb.formatDateSQLField to check the values and convert them to sql date format. * In Disp Context: Translates the default sql date format to the date format set in the rdata datesql. * Usage of rdata datesql: {date format m, d, Y separated with / or -}:{string for default value (today):{boolean 1 or 0 to display link to popup calendar}:{boolean 1 or 0 to hide the field} Example: Invoice Date m/d/Y:today:: strFBFieldTypeDateSQL date ===== SQL Time ===== * Radria fieldtype: strFBFieldTypeTimeSQL * SQL Type: time * rdata (options): default, hidden, readonly, label, timef, ordering, dispalign * In Context Form: Generates an HTML input text field, and adds the event-action mydb.formatTimeField to check the values and convert them to sql time format. * In Context Disp: Displays the content of the field. * Usage of rdata timef : { string for default value : now}:{boolean 0 or 1 to hide the field} Example: now:1 strFBFieldTypeTimeSQL time ====== All rdata options ====== **access**: Used by login and password fields, it can only take the values “password” or “login”. The table must have both fields. Usage : {string login or password} **checkbox:** (depreciated) Used by the checkbox type to display the field as a checkbox in a form. It Requires the default rdata for the value that will be inserted when the checkbox is checked. Usage: {boolean 0 or 1} **checked_value:** Used in checkbox field type to fill in the content of the checkbox field with a value. Usage: Yes **databasetype**: Used by the CRUD functionalities when generating SQL queries to manage the data. **datef:** Used by the Unix date type to set the format of the date and whether it is hidden or not. {date format m, d, Y separated with / or -}:{string for default value (today):{boolean 1 or 0 to hide the field} **default**: Default value to put in a field. You can display the content of a global variable with the notation [variablename]. You can also call custom functions [functionname;param1;param2...;paramn]. The function is sent one parameter with all the params in an array. The value returned by the function is the value displayed in the field. Usage: {[global_variable_name] or string} Curently there are 2 default functions that can be called: getparam: That will get the default value from a param in a saved event object. Usage: [getparam;name_of_the_saved_event;name_of_the_param] getfromarray: That will get the default value from an associative array. Usage: [getfromarray;name_of_the_array;name_of_the_key] See function call for default values **disabled**: Will set the field as disabled, the field will not be submited, and the user cannot access its content but it will be visible. See the disabled property for input fields in HTML documention. Usage: 1 **dispalign:** Tells how to align the field in a display context, used by reportTable to align the field within the table cell, default alignement is left. (note: not all report templates implement that rdata option) Usage: right will align the field to the right. **email:** Used by the Email field type to trigger the event-action to check the email and display it as a mailto link. Usage: {boolean 0 or 1} **emptydefault:** Used by the list box to not add a default empty option value in the selection. Usage: no **execute:** Will let the reports and forms execute the PHP code in the database. By default PHP tags are escaped from the database content. If you turn that flag on (1) all PHP code in text and text area fields will be executed. Usage: {boolean 0 or 1 **hidden:** Used by all field types. It hides the field in all contexts and displays only an HTML input hidden field. Usage: {boolean 1 or 0} **html**: Used by the Text Area Type. If it is set to “1”, the text area will display any html code instead of displaying it's content. Usage 1 **list:** Used by the List Box field type. It specifies the table that contains values for the list. Usage: {table name}:{table field name to display}:{table field name to insert in current field}:{default value}:{ sqlSavedQuery name} **listfile:** Used by the List File field type. It specifies the directory name and file extension to select. Usage: {directory path}:{file extension}:{default value} **listvalues:** Used only by the small listbox to store the values of the drop down, this rdata is optional. **Listlabels:** Only used by the small listbox to store the label visible in the drop down, if listvalues is not set they will be used for the value of the field. **label:** A text label that is displayed next to the form field or display. Usage: {string with label} **numberformat:** Format a number field, display float and integer numbers in human readable format. Works like the number_format() function in PHP, plus a prefix string and postfix string. Usage: pre_string:number_of_digit:decimal_separator:thousand_separator:post_string Exemple: $:1:.:,:- will generate for 54134.342: $54,134.3- **ordering:** Will be used by reportTable and reportForm to order the fields. The order is descendant. Usage: 20 **overwrite**: It is used for the file field, when set to “no” and 2 files with the same name are uploaded in the same folder, the second file will be renamed with the following: n9_original_file_name. Usage: no **picture:** Used by File Field type to get the directory where to upload the files. And optionaly the default file name. Usage: {directory name}:{default filename} **radiobutton:** Used By the Radio Button field type to specify the table that contains the content of each radio button. Usage: {table name}:{table field name to display}:{table field name to insert in current field}:{default value} **radiovalues:** Used only by the small radio button to store the values of the radio buttons, this rdata is optional. **radiolabels:** Only used by the radio button small to store the label visible of the radio buttons, if radiovalues is not set they will be used for the value of the fields. **readonly:** Used by all field types to show the content of the field only in Disp context. Usage: {boolean 1 or 0} **required:** Used by all field types, it adds the event-action mydb.checkRequired to make sure that the field is not empty. Usage: {boolean 1 or 0} **showpicture:** Used by the File field type to specify if html img tags should be displayed for that file. {boolean 0 or 1} **substring:** Used in Text line and text area fields to limit the number of characters displayed. To display only the first 50 characters: 50 **textarea:** Useg by the text area field type for the cols, lines and wrap type. Usage: {cols}:{lines}:{wrap} **textline:** Used by one line text and all of the field types that extend it: Floats, numbers, and integer numbers. Usage: {display size in caracter}:{maximum number of characters for input} **vertical:** Used by the radio button, to display them one by line or all on one line. Usage: no will display them all in one line.