[go: up one dir, main page]

0% found this document useful (0 votes)
78 views5 pages

Field Element As QR Code

This document provides instructions for configuring a field element plugin in Joomla. It describes various options for controlling the field properties like default values, input type, formatting, and more. Examples are given for generating random strings and displaying values as QR codes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views5 pages

Field Element As QR Code

This document provides instructions for configuring a field element plugin in Joomla. It describes various options for controlling the field properties like default values, input type, formatting, and more. Examples are given for generating random strings and displaying values as QR codes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Field element as QR Code

 Page
 Attachments (6)

Field element

o Hidden - sets the date to be rendered as a hidden field


o Default - The default value to populate the element with. If the eval option is
selected then this should contain a PHP expression
o Eval - If set to yes then the value entered in the default field is taken to be a PHP
expression and is evaluated as such. Element default examples.
o Placeholder - Text to show inside the field, when the user has not yet entered a
value
o Input type - Defines which HTML input type to use.
o Max length - The maximum number of characters the user is allowed to type into
the field.
o Disable element - Disable the element, the user is not allowed to changed the
value and the value is NOT stored in the database.
o Read only - The user is not able to change the field's value but the value IS stored
in the database.
o Auto complete - If set to yes (default behavior) then the browser will show any
previously entered values for any field which had the same name. Note this is
NOT an ajax auto-complete look-up to the database. For that use the database join
element rendered as auto complete.
o Speech recognition - Currently for Chrome 11 + only. Enables text entry via your
microphone.
o Bootstrap class - Adds a class to the input, which defines the input's width.
o Format - Define what type of data the field should store in the database
o Integer length - The length of the integer field when the format is set to integer
or decimal
o Decimal length - The decimal length stored in the database when the format is set
to decimal
o Number format - If yes, value will be processed through PHP's number_format()
function, which will insert thousand separators, and use the decimal point you
specify below. So (for instance) to format French numbers, you would use a
Thousand Separator of '#32' and a Decimal Point of '.'.
This option will also use the Decimal Length option, rounding the number if
necessary.
Formatting is only applied when rendering the number in a list or detail view,
does not affect how the value is stored in the table.
Note: number_format() will be applied BEFORE any sprintf() format you may
specify in the 'Format string' option, which may mean that sprintf may not
recognize the value as a number.
o Thousand Separator - If you selected Yes for Number Format, this will be used
as the thousand separator. If you need to specify a space (i.e,. for French number
formatting), put #32 instead (Joomla strips spaces from parameters when saving,
so you can't just put a space here!).
o Decimal Point - If you selected Yes for Number Format, this will be used as the
decimal point character.
o Format string - Applies the PHP sprintf function to the string when displaying
the data in the list view or detailed view.
o Input Mask - An input mask string. This uses the input mask jQuery plugin
http://digitalbush.com/projects/masked-input-plugin/. It allows a user to more
easily enter fixed width input where you would like them to enter the data in a
certain format (dates,phone numbers, etc).
This string will input mask : '9' represents a number, 'a' represents alphabetic
character (A-Z,a-z), * is either. Characters after '?' are optional. Other characters
are inserted in the result.
Examples :
- a US telephone number with 3 digit extensions : (999) 999 9999 x999
- same number with optional digits would be : (999) 999 9999 x999? x99999
- a serial number would be : aa/999-99-9999
- a date : 99/99/9999
o Display as QR Code - Display value as a QR Code in read only views (list,
details, or form where element ACL is read only)

o Guess link type - Will try to guess if the data entered is a URL or email address,
if so then in the list view and detailed view the data is wrapped within the
corresponding link
o Link target - sets whether the created link will open in a new window.

Creating/Generating a Random String, example a password generator (This has been


created from a forum post)
Follow the steps below:
o Create a new element using the field plugin
o Add the following code into the default field area

PHP:

$length = 10;
 
  $key = "";
 
  // define possible characters
 
  $possible = "0123456789bcdfghjkmnpqrstvwxyzBCDFGHJKLMNPQRTVWXYZ";
 
  $i = 0;
 
  while ($i < $length) {
 
    $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
 
      $key .= $char;
 
      $i++;
 
 }
 
return $key;

o Below this area, make sure you turn the EVAL Option ON.
o Save and refresh your form, you will have a random number generated on the
form page.

You might also like