Skip to main content
Participant
November 24, 2017
Answered

How to Format text field to alpha only

  • November 24, 2017
  • 10 replies
  • 5390 views

Anyone have insight on the custom format script for creating text fields with alpha only input?

This topic is closed to new replies. Start a new post to keep the conversation going.
Correct answer try67

You can use this code as the custom Keystroke script:

if (event.change) event.rc = /^[a-z]+$/i.test(event.change);

10 replies

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
November 24, 2017

You can use this code as the custom Keystroke script:

if (event.change) event.rc = /^[a-z]+$/i.test(event.change);

Known Participant
September 5, 2018

I have a field - Case Name, and I used the coding above - if (event.change) event.rc = /^[a-z]+$/i.test(event.change); - and yes I can only type alpha characters in it, which is great but I cannot put a space between the first and last name.

Example: Jane Doe becomes JaneDoe

Is there a way to allow spaces?

Thank you,

Jamie

try67
Community Expert
Community Expert
September 5, 2018

Simply add a space character inside the square brackets.

However, names can contain all kinds of characters, beside letters and spaces. What about hyphens? Apostrophes? Periods?