Remove hyphens, extra spaces from field value

  • 0
  • 1
  • Question
  • Updated 5 years ago
  • Answered

Can we modify a field so it accepts only accept numbers and letters.

We have a field in place which is set up as text and unique valueoption for the field is checked.

However if someone enters dash’s and someone doesn’t, they can both submit the same record.

Is there a formula to return the absolute values for a "Text" field?

Photo of Shaveta


  • 0 Points

Posted 5 years ago

  • 0
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 30,204 Points 20k badge 2x thumb
Use the image onload technique with the code in this pastie:

Pastie Database

Everytime there is a keyup event on the field with fid=7 the value of the field will have all numbers or upper or lower case letters replaced by an empty string. No validation or dialog is necessary as the code will simply remove bad characters as soon as they are typed in.