Hello, I'm working on a basic credit card form entry page and I need to support masks for Visa and AMEX.
I want to update the mask when a user inputs certain characters. This check should happen after each character is typed, something like this:
if (e.DataFormItem.Name.Equals("CardNumber"))
{
(e.DataFormItem as DataFormMaskedEditTextItem).KeyBoard = Keyboard.Numeric;
(e.DataFormItem as DataFormMaskedEditTextItem).MaskType = Syncfusion.XForms.MaskedEdit.MaskType.Text;
if (e.DataFormItem.LabelText.StartsWith("34") || e.DataFormItem.LabelText.StartsWith("37"))
{
(e.DataFormItem as DataFormMaskedEditTextItem).Mask = @"0000 000000 00000";
}
else
{
(e.DataFormItem as DataFormMaskedEditTextItem).Mask = @"0000 0000 0000 0000";
}
}
The problem here is that the mask is only set once when the dataform is auto generated.
Is there a way to do this with SfDataForm? Thanks!