[Input Masks Mobile] InputMask with validation

[Input Masks Mobile] InputMask with validation

  
Forge Component
(7)
Published on 2017-11-15 by Labs
7 votes
Published on 2017-11-15 by Labs

Hello everyone.

I'm trying to get form validations working for an input mask field.

As this plugins creates another html input and hides the original one, how is possible to get form validation (Outsystems way - Widget.Valid / ValidationMessage) working ?

Cheers

Luciano Guimaraes

Hello Luciano,

When you talk about form validations, I'm assuming that you are talking about mandatory fields and/or correct types (Like typing text in a number input).

Regarding this validations, the component already takes care of that for you:

  • Mandatory fields
    • Since your input is the one that is connected to the variables and the form, and having in consideration that the mask passes the value directly to your input, the mandatory validations are also done.
    • The red highlight and the error message is also shown.
  • Correct types: regarding this validation, the component does that for you as well, meaning that we will not accept chars that are not number related.


Does this cover your needs, or do you have a different scenario? 


Cheers,

Samuel Jesus

Hi Samuel. Thanks for answering.

I'm talking about custom field validations.

The use case is when I have a more complex logic to validate a field value (day of the week 1-7, for instance).

I setup this logic on the "OnSave" button and filled Valid and ValidationMessage attributes for the corresponding field.

When this same field has inputMask, the custom message is not being show.

Cheers

Luciano

Hello Luciano.

Those custom validation messages weren't being shown due to a small code bug.

The good news is a new version was just released with that specific fix (version 1.0.4).

Please download the new component version and let us know if your use case is covered.

Cheers,

Samuel Jesus

Hi Samuel,

I saw the update! Very cool.

Thanks.


But I have another problem related to validation.

The variable is text, and I just type numbers!

The OS returns validation "Text expected!".

I can´t change the type because it is JSon structure, used elsewhere...


Suggest something?

Hello Maurilio.

I do understand the issue you are experiencing, and I was trying to replicate it in order to find a workaround for you, but so far I was not able to replicate it.

Can you please replicate the issue in a clean eSpace and share it with us?

Cheers,

Samuel Jesus