Although you can't directly apply a change to the template of a Text Field ("CText") after it has been set in Mi-Forms Designer, you can employ a workaround depending upon your requirements.
One workaround is to set up the CText field to handle all possible solutions. For example, if you can start with a template that allows both alpha and numeric characters. Next implement a check on the CText value depending upon what is selected in a separate field, such as a picklist or check box group.
An example of this implementation is below. Using AfterSetData event handlers on a Picklist and CText that checks the value of the CText field against what is selected in the Picklist, either "Alpha" or "Numeric". Also included is a Dynamic Label that ouputs workflow messages to the form.
<MiCode(ControlScriptEventType.AfterSetData, "TextField")> _
Public Sub Ctl_TextField_AfterSetData(ByVal e As AfterSetDataEventArgs)
CheckCTextValue
End Sub
<MiCode(ControlScriptEventType.AfterSetData, "Picklist")> _
Public Sub Ctl_Picklist_AfterSetData(ByVal e As AfterSetDataEventArgs)
CheckCTextValue
End Sub
Sub CheckCTextValue
Dim picklist = Me._Picklist.Value
Dim ctext = Me._TextField.Value
Dim message As String
If String.Equals(ctext,String.Empty) Then
message = "The CText Value is Empty"
ElseIf String.Equals(picklist,String.Empty) Then
message = "The Picklist Value is Empty"
Else
If String.Equals("Alpha", picklist) Then
If Regex.IsMatch(ctext, "^[a-zA-Z]+$") Then
message = "You chose 'Alpha' and the CText value contains only alpha values"
Else
message = "You chose 'Alpha' and the CText value contains non-alpha values"
End If
ElseIf String.Equals("Numeric", picklist) Then
If Regex.IsMatch(ctext, "^[0-9]+$") Then
message = "You choose 'Numeric' and the CText value contains only numeric values"
Else
message = "You choose 'Numeric' and the CText value contains non-numeric values"
End If
End If
End If
Me._DynamicLabel.Value = message
End Sub
A copy of the MFD exemplifying this solution is attached to be downloaded.