password validation with regular expression in traditional web application

Hi, 

How could I set a regular expression for a input field in traditional web application.

What do you want to achieve? You would need to either use the Regex after the submit of the form or via an OnChange activity. You can't bind a regex to an input for input validation directly. 

Vincent Koning wrote:

What do you want to achieve? You would need to either use the Regex after the submit of the form or via an OnChange activity. You can't bind a regex to an input for input validation directly. 

for onChange action I want to use regular exp, how could I do that one.can you please suggest me how to do.


Hi Anusha,

You can't bind a regex directly to an input field however you can achieve that through javascript.

Hi Anusha,

Refer attached screenshots, you will find the regex actions in Text library, so add the dependencies from there.

Hi,

You can do something like this on your action

The PasswordInput name is the name that i gave to de widget input and Regex_Serch action cames from extension Text.

Pattern used in the exemple (accepts between 8 and 15 characters long, string must contain at least one number, at least one uppercase letter, at least one lowercase letter and at least one special character):

"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).{8,15}$"


I don't know if it is applicable, but I would suggest using it in a button action instead of OnChange, so I am not constantly validating each change

Hpe this help! :)

Hi Anusha,

You can follow the steps, they should get you up-to speed;

  1. Create a form with an input (you already did that)
  2. Make sure this form inside a container 
  3. Make sure to give this container a name
  4. On one input add an OnChange action;
  5. Add an input parameter with the name NewText and bind that to the OnChange action to fix the outstanding error. The value inputted should something like: DemoStrucForm.Record.Place
  6. Add a reference to the action "Regex_Search" from the Text component
  7. Add the Regex_Search to the OnChange function and fill in the parameters as follows, of course you will use your own regex
  8. Check if the text matches with the regex and if not set the correct form properties to false together with a warning text. It should look like this;

  9. Thats it. I also attached the OAP for your reference
    Url: https://vkoning.outsystemscloud.com/ForumInputOnChange/Demo.aspx





Vincent Koning wrote:

Hi Anusha,

You can follow the steps, they should get you up-to speed;

  1. Create a form with an input (you already did that)
  2. Make sure this form inside a container 
  3. Make sure to give this container a name
  4. On one input add an OnChange action;
  5. Add an input parameter with the name NewText and bind that to the OnChange action to fix the outstanding error. The value inputted should something like: DemoStrucForm.Record.Place
  6. Add a reference to the action "Regex_Search" from the Text component
  7. Add the Regex_Search to the OnChange function and fill in the parameters as follows, of course you will use your own regex
  8. Check if the text matches with the regex and if not set the correct form properties to false together with a warning text. It should look like this;

  9. Thats it. I also attached the OAP for your reference
    Url: https://vkoning.outsystemscloud.com/ForumInputOnChange/Demo.aspx








I didnt find the regex-search in the environment.

You can find the regex-search action in the Text module. Something went wrong in my initial document. I'll fix it. See the screenshot below on where to find it.


edit: I have no idea what is going wrong with pasting an image......

Patrícia Oliveira wrote:

Hi,

You can do something like this on your action

The PasswordInput name is the name that i gave to de widget input and Regex_Serch action cames from extension Text.

Pattern used in the exemple (accepts between 8 and 15 characters long, string must contain at least one number, at least one uppercase letter, at least one lowercase letter and at least one special character):

"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).{8,15}$"


I don't know if it is applicable, but I would suggest using it in a button action instead of OnChange, so I am not constantly validating each change

Hpe this help! :)


Hi Anusha Reddy,


You can use the approach of Patricia and Vincent for Server Side Validations:

The action Regrex_ Search action is inside the Text extension:


For Client Side validations you can use the pattern and the expression that you want to validate:



Don't forget to check the button of your form with Client and Server Validations: