cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Validation for special characters on column

Jump to solution

I need to prevent a user from inputting special characters in a column.  Can someone clue me in on how to set a validation rule to do this?  I assume it may need to be javascript which I have very little experience dealing with.

 

Thanks.

Labels: (1)
Reply
14 Replies
Workflow Hero

Re: Validation for special characters on column

Jump to solution

Hi Scott

 

are You using Nintex Forms? Then You can use regular expression for validation:

 

 

    /^[^ab]+$/

        ^ assert position at start of the string

        [^ab]+ match a single character not present in the list below

            Quantifier: + Between one and unlimited times, as many times as possible, giving back as needed [greedy]

            ab a single character in the list ab literally (case sensitive)

        $ assert position at end of the string

 

 

Kind regards

 

Manfred

Reply
Not applicable

Re: Validation for special characters on column

Jump to solution

Thank you.  I went the other way and just allowed alphanumeric characters but I appreciate the help since it sent me in the right direction.

0 Kudos
Reply
Not applicable

Re: Validation for special characters on column

Jump to solution

Hi Manfred,

I have problems when I tried validate the illegal characters. I tried to change this

/^[^ab]+$/

for this

/^[^~ " # % & * : < > ? / \ { | }]+$/

how do I do for resolve my problem?.

Can you give me an idea for resolve my problem?

Kindly Regards

0 Kudos
Reply
Not applicable

Re: Validation for special characters on column

Jump to solution

I had a lot of problems too but I got it working today.

I used (You may need to include more special characters in this one):

^[^!#$%@~`/*]+$

RegExpr_SpecialChars.png

0 Kudos
Reply
Not applicable

Re: Validation for special characters on column

Jump to solution

Or I just figured this one out. It allows only letters and numbers

^[a-z A-Z 0-9]+$

RegExpr_OnlyLettersNumbers.png

Reply
Not applicable

Re: Validation for special characters on column

Jump to solution

Hi Core, thanks for your answer.

I copied your example in my form and worked ^[^!#$%@~`/*]+$

But when I add more characters like ^[^!#$%@~`/*&{}<>;?/"|]+$  the validation don't work like I want.

Untitled.png

Untitled2.png

0 Kudos
Reply
Not applicable

Re: Validation for special characters on column

Jump to solution

thanks Core, but only need illegal characters. I don't know where is the error. Only copy your example and add more characters.

Regards

0 Kudos
Reply
Not applicable

Re: Validation for special characters on column

Jump to solution

Yeah I just noticed the same (I suspect some are reserved characters). Would allowing only letters and numbers work for your forms? If yes, try this one:

^[a-z A-Z 0-9]+$

Reply
Not applicable

Re: Validation for special characters on column

Jump to solution

Ok let me try.

0 Kudos
Reply