SmartClient Version: v11.0p_2017-02-11/PowerEdition Deployment (built 2017-02-11)
I have a form bound to datasource.
I have set the masking on phone number field and want the masked data to be saved in DB.
((TextItem) form.getField("phone").setMask("(###) ###-####");
((TextItem) form.getField("phone").setMaskSaveLiterals(true);
Now before saving i need to check that the user enters the numbers in above format and should contain 10 digits. I tried
MaskValidator phnvalidator= new MaskValidator();
phnvalidator.setMask("(###) ###-####");
form.getField("phone").setValidators(phnvalidator);
But still the validation does not happen. Even if i enter 33, it gets saved
I have a form bound to datasource.
I have set the masking on phone number field and want the masked data to be saved in DB.
((TextItem) form.getField("phone").setMask("(###) ###-####");
((TextItem) form.getField("phone").setMaskSaveLiterals(true);
Now before saving i need to check that the user enters the numbers in above format and should contain 10 digits. I tried
MaskValidator phnvalidator= new MaskValidator();
phnvalidator.setMask("(###) ###-####");
form.getField("phone").setValidators(phnvalidator);
But still the validation does not happen. Even if i enter 33, it gets saved
Comment