Changes

Jump to: navigation, search

JavaScript Validation

442 bytes added, 14:52, 9 July 2021
To limit the amount of characters that can be entered into a field
The JavaScript syntax can be entered into the ''JavaScript Validation'' field on the custom field settings page.
 
If '''SmartCheck''' is enabled, every reference to "frm.cf_''fieldid''.value" should be changed to;
form.getStr("cf_fieldid")
==To accept only certain values==
==To limit the amount of characters that can be entered into a field==
 
@value@.length<''n''
@value@.length<35
 
==To validate the length of a number entered into a field==
@value@.toString().length==n
 
'''Where'''
 
''n'' is any number
 
'''Example'''
 
To see if the length of a number is 10
 
@value@.toString().length==10
==To have a custom field only accept values in a range==
frm.cf_@Project Budget.id@.value>=@value@
 
If SmartCheck is enabled, use the following instead;
form.getStr("cf_@Project Budget.id@") >= @ value@
2
edits

Navigation menu