you can use this to disable the submit button of the form by check
if(Or(
And(
Len(TextInput2.Text) = 11,
!IsBlank( Match(TextInput2.Text, "^\d{6}[-A+]\d{4}$").FullMatch)
),
And(
Len(TextInput2.Text) = 9,
!IsBlank( Match(TextInput2.Text, "^\d{6}-\d{2}$").FullMatch)
)
),displaymode.edit,displaymode.disabled)
and also if you are using form for datacard you would have a errormessage in datacard control you can make it visible by using below formula on visible property
Not(Or(
And(
Len(TextInput2.Text) = 11,
!IsBlank( Match(TextInput2.Text, "^\d{6}[-A+]\d{4}$").FullMatch)
),
And(
Len(TextInput2.Text) = 9,
!IsBlank( Match(TextInput2.Text, "^\d{6}-\d{2}$").FullMatch)
)
))
for error message text property you can give what you need to display if the user enter wrong format.
Please click Accept as solution and Thumbs Up. if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
You can connect with me on LinkedIn