Minimum number of characters in text field


How can I set the minimum number of characters in a text field? I'm using the code below to set the maximum number of characters but I need to set the minimum as well?

Please assist.

//Limiting Phone field to 9 characters
text = fd.field('PhoneNumber').value;

function limitCharacters(fieldName){
var newText = fd.field(fieldName).value;
if(fd.field(fieldName).value.length > 10) {
fd.field(fieldName).value = text;
else {
text = newText;

fd.field('PhoneNumber').$on('change', function(value) {

Never mind, I was able to do it with the following regular expression


1 Like