Performing custom validation without using button widget

I need to perform custom validation without using a button.

the user should get the validation message when it fills wrong datatype in the input fields eg: it should accept only text data in a name input field and so on.

Solution

Hello Abhishek,

You can use JavaScript to resolve your issue. On the input fields extended property select ONKEYUP and put below javascript code there in expression editor.

"this.value=this.value.replace(/[^a-zA-Z]/g, '')"

I hope this helps you.

Regards,

Ajit kurane.

Champion

You can use any available REGEX Lib from Forge for the same.
https://www.outsystems.com/forge/component-overview/6578/regex-client-side-validation-sample
https://www.outsystems.com/forge/component-overview/9512/regex-how-to

In case you want it to be custom then you can define JS Snippets that target respective inputs types.

Hope it helps,
Assif

Hi Abhishek,

You can use the input fields 'OnChange' event to define an action with custom validation. Not only this option will allow you to use the platform's builtin datatype validation, but will also implement it without using a button.

Let mw know if this worked for you.

Best regards,

Ricardo

Solution

Hello Abhishek,

You can use JavaScript to resolve your issue. On the input fields extended property select ONKEYUP and put below javascript code there in expression editor.

"this.value=this.value.replace(/[^a-zA-Z]/g, '')"

I hope this helps you.

Regards,

Ajit kurane.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.