on 09-14-2017 6:54 PM
Hi,
I have form with some fields and validations attached to it.
I have added the constraints to validate the data. Everything works fine and it gives the error if wrong data or in wrong format.
Unfortunately, it shows error on the optional field as well because I have added the constraint to it to validate data in the correct format. I have phone field and I need data in the format xxx-xxx-xxxx.
For this, i have added below constraint.
<Input id="iCommNum" maxLength="12" value="{path: 'AddAddress>/Number1', formatter: '.formatter.formatTelephone', type:'sap.ui.model.type.String' , constraints : { search : '^\\d{3}-\\d{3}-\\d{4}' }}" width="10em" type="Tel" placeholder="XXX-XXX-XXXX"/>
With this, even value is blank, it throws an error. I want to show error only if user enters something and not in the correct format. If no values provided, no error should be shown.
Let me know how that can be achieved.
-Bhavik
Hello,
Have you try the UI Control sap.m.MaskInput ?
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
69 | |
8 | |
8 | |
6 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.