You are viewing limited content. For full access, please sign in.

Question

Question

Regular Expression in a Multiple line field

asked on May 23, 2017

Hello,

Is there a way to add a regular expression validation in a multiple-line field?

Regards

0 0

Answer

SELECTED ANSWER
replied on May 23, 2017
0 0
replied on May 25, 2017

Alright i will to go these post and see. Thank you

0 0
replied on May 26, 2017

I got the answer from the first link itself. Here is the code i used:

$(document).ready(function () { 
  $('.numbers textarea').keyup(function() {
    var invalidChars = /[^0-9\n\r]/gi
    if (invalidChars.test($(this).val())) {
      $(this).val($(this).val().replace(invalidChars,""));
    }
  });
});

Thank you Alex

0 0
replied on May 26, 2017

Awesome, glad to see you got it working!

0 0
replied on February 23, 2018

Thanks for sharing.  I modified this to prevent the entry of characters which are not permitted in file names.  Hope this saves someone so time:

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.