Difference between revisions of "Form - Field Formatting"

From All n One's bxp software Wixi

Jump to: navigation, search
(Created page with "= Overview = In a form you may like to apply some formatting to your fields. This is often done in tools like Microsoft Word and Excel to tidy up data. bxp provides a for...")
 
m
Line 22: Line 22:
 
= Functions available =
 
= Functions available =
  
{! class="wikitable"
+
{| class="wikitable"
 
! Type
 
! Type
 
! Function name
 
! Function name
Line 101: Line 101:
 
| || fn_isUKPostCode(addressStr) ||
 
| || fn_isUKPostCode(addressStr) ||
 
|-
 
|-
!}
+
|}
  
 
[[Category:Topic:JavaScript]]
 
[[Category:Topic:JavaScript]]

Revision as of 19:43, 21 November 2016

1 Overview

In a form you may like to apply some formatting to your fields. This is often done in tools like Microsoft Word and Excel to tidy up data.


bxp provides a formatting library with numerous functions to help tidy up your data as people perform data entry.


You can also apply sense checks on the data so users can update the information in real time.


This ability does use JavaScript, but as you will see, application can be very easy indeed.


The library is publicly available as https://ww3.allnone.ie/library/javascript/fn_javascript_formatting.js


We don't take credit for coming up with all these amazing functions, so in the source you can see where we got the information to build them from, if it was from out on the net.


2 Functions available

Type Function name Description
String Functions
fn_Formatting_UpperCase(str)
fn_Formatting_LowerCase(str)
fn_Formatting_TitleCase(str)
fn_Gen_TrimSpaces( strData )
fn_Gen_String_Left(str, n)
fn_Gen_String_Right(str, n)
fn_General_RemoveAllStrings( strString )
fn_String_ReplaceAllOccurrences(strValue, strReplace)
fn_String_ReplaceAllOccurrencesCustom(strValue, strReplace, strReplaceWith)
fn_Gen_EuroSymbol ( strData )
fn_General_ReplaceLineBreaksController( strObjectId, strReplaceChar, blShow_Prompt )
fn_General_ReplaceLineBreaks( strObjectId, strReplaceChar )
Number and Currency functions
fn_Formatting_LeadingZeros(num, size)
fn_Gen_LeadingZeros (num, size)
fn_Formatting_NumbersOnly(value)
fn_Formatting_MinimumDigitsCheck(value, intLength)
fn_Formatting_FormatMoney(value, n, x, s, c)
fn_String_CurrencyCommaFormatting ( strValue )
fn_String_FormatTwoDecimalPlaces (amount)
fn_String_FormatCurrencyCommas(amount)
fn_TidyPercent (strString)
Date functions
fn_Formatting_EuropeanDate(inputFormat)
fn_Gen_ZuluTime ()
Validation functions
fn_isEmail(argvalue)
fn_isDate(dateStr)
fn_isNumeric(sText)
fn_isApproved(sText, strChars)
fn_General_MatchMobilePattern( strString )
fn_Campaign_PhoneValidate( strHome, strWork, strMobile, strRule )
fn_General_ValidatePhone_Irish ( strPhoneField, blReplaceWithClean, blReplaceWithBlank )
fn_General_ValidatePhone_Explicit_Irish ( strPhoneField, blIsMobile, blReplaceWithClean )
fn_Formatting_IsUKPostCode(postcode)
fn_isUKPostCode(addressStr)