FM BetterForms
BF Editorfmbetterforms.com
1.0 dont use
1.0 dont use
  • Introduction
  • Features Summary
  • Getting Started
    • System Overview
    • Integration
      • 1. Configure FileMaker Server
      • 2. Add your Server to BetterForms
      • 3. Introduction to Hooks
      • 4. Create your first Site
      • 5. Create your first Page
      • 6. Configure your FileMaker File(s)
      • 7. Run your first Hook
      • Next Steps
    • Common Customizations
      • Introduction to Actions
      • Introduction to Buttons
      • Page Navigation
      • Displaying Data in a Table
    • Support
      • Hacking a Webpage
      • Learning JSON
  • Reference
    • Site Settings
      • Navigation
      • Slots / Code Injection
      • App Model
      • Site-wide Named Actions
    • Page Settings
      • Data Model
      • Card / Window Modals
      • Validation
        • Custom Validators
      • Misc Page Settings
    • Page Elements
      • Common
        • Button
        • Data Table
        • HTML
      • Grouping Elements
        • Tabs
        • panel
        • accordion
        • listrows
      • Uploading Files
        • dropzone
        • dropzone to S3
        • uploadCare
      • Misc Elements
        • Plain Text / Code Editor
        • signature
        • fullCalendar
        • rangeSlider
      • Payment Gateways
        • Authorize.net
        • PayPal
        • Stripe
      • Adding Custom Page Elements
    • Actions Processor
      • Named Actions
      • Actions
        • runUtilityHook
        • path
        • debounce
        • throttle
        • showAlert
        • showModal / hideModal
        • function
        • clipboard
        • cookie
        • setFocus
        • wait
        • emit
        • validate
        • channelJoinAnon
        • channelLeaveAnon
        • messageSend
        • messageSendAnonChannel
      • Authentication Actions
    • Script Hooks
      • Globals Variables
        • $$BF_Model
        • $$BF_App
        • $$BF_State
      • Keeping Keys Private
      • Reducing Payload Size
      • API Callback Endpoint
      • Common Hooks
      • Scoped Hooks
    • Users & Authentication
      • Managing User Accounts
      • Custom Login Pages
    • Advanced Configuration
      • Custom Domains
    • BF Utility Functions
    • BF Error Codes
    • Messaging
      • Adding users to channels
      • Removing users from channels
      • Sending messages
      • Get connected users
      • Get active channels
  • Usage Tips
    • Troubleshooting
      • Debugging
      • Frozen Actions Queue
    • JavaScript Tips
      • Calling Named Actions from HTML Vue Events
      • Calculations
    • System Overview
    • Forms Processor
      • Form Types
      • HTML & VueJS
      • Styling and Design
      • JS Caclulations and Functions
    • Customizing and Styling
      • Custom Components
      • Custom CSS
      • Custom Components
      • Page Pre-loaders
      • Favicon
    • Design Patterns and Best Practices
      • Working with environments
      • Handling Data
      • Saving Data
      • Optimization
      • Business Logic
      • UI / UX
  • Security
    • Authentication
    • Security White Paper
    • Firewalls
    • Technology Stack
  • Compatibility
Powered by GitBook
On this page

Was this helpful?

  1. Reference
  2. Page Settings

Validation

PreviousCard / Window ModalsNextCustom Validators

Last updated 3 years ago

Was this helpful?

Client side validation is controlled by the validator key in all page elements.

// Example
{
  "inputType": "text",
  "label": "Last Name",
  "model": "nameLast",
  "required": true,
  "styleClasses": "col-md-3",
  "type": "input",
  "validator": "string"
}

Validation does not __ run automatically. You must trigger client validation with the

The validator key can be set to the following:

number Checks that the value is numeric - and that it's within the fields min & max range, if these are defined in the schema. integer Checks that the value is a valid Javascript Number - and that it's an integer.

double Checks that the value is a valid number.

When validating with number, integer, or double, make sure the inputType for the field is set to number, otherwise the input will be saved as a JSON string in your data model.

string Checks that the value is a string - and that its length is within the fields min & max range, if these are defined in the schema.

array Checks that the value is an array - and that the arrays length is within the fields min & max range, if these are defined in the schema. Expects the value to be a valid Javascript array literal - something like this: ["John", "Doe", "Jane"] or [1, 2, 3].

date Checks that the value is a valid Javascript Date - and that the date is between the fields min and max dates, if these are defined in the schema.

regexp Checks that the value matches the regex defined in the fields schema.pattern. If schema.pattern isn't set, validation is skipped.

email Checks that the value is a plausible looking email address, using a regular expression.

url Checks that the value is a plausible looking http url, using a regular expression. Among other checks, the URL needs to start with http:// or https://.

creditCard Checks that the value is a valid credit card number, using code from here.

alpha Checks that the value is a letter, using this regex: /^[a-zA-Z]*$/

alphaNumeric Checks that the value is a letter or a number, using this regex: /^[a-zA-Z0-9]*$/

This validation works great as a user interface element, but should not be trusted in FileMaker. Anything that comes from the a client's web browser can be hacked, so sensitive data should also be validated in your FileMaker scripts before committing to the database.

Source:

validate action.
https://icebob.gitbooks.io/vueformgenerator/content/validation/built-in-validators.html