Link Template Email Validation.
Author: sivaprasad9394
Publication Date: 2/24/2015 10:31
Dear All,
I have to allow any number of white space infront and back of the email address.
Because email address is copied from the webpage and there is a chance of the white space added in leading and trailing of the email address.
To remove leading and trailing whitespace regx:
/^\s+|\s+$/g
How to add the condition in regx?

Thank you.
Tags: email, regx
-
Author: pavone - 2/24/2015 13:11
Hello,
this should work:
<MATCHES regex="^\s*.+\@.+\.[a-zA-Z]{2,6}\s*$">Best regards
Tim
0 -
Author: pinarodrigo - 2/24/2015 13:55
Hello Tim,
The new rule will allow email addresses with leading & trailing whitespaces, whici is ok to remove the error message from the form.
BUT what if still need the value of the email address field to be trimmed? So that further usage of those email addresses (with whitespaces) does not lead to runtime errors.
Is a Trim/modification of the field'S value possible with rules?
0 -
Author: pavone - 2/24/2015 14:44
You could try to create a value service that returns the trimmed address. That value could then be inserted into the form.
But I'm not sure if this is a good solution because an ON_SAVE rule is not only called when you press the save button but many times before while you type. I'm not sure how it will behave if a rule tries to set the value of the form element you're currently editing.
0 -
Author: MichaelaReydt - 3/11/2015 15:20
Hello,
do you need further help or did Tim's answer already help you? If so it would be nice, if you mark his "correct answer".
If you have already found solution by yourself it would be kind if you post it here.
Best regards
Michaela
0 -
Author: sivaprasad9394 - 3/12/2015 5:32
Hello Michaela Pahl,
Thank you for your reply.Tim answer is hepful.
Thank you.
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
5 commentaires