Dear Guys,
I need a validation method to be done when a key pressed on a text field in a form. This is used for tracking number in edit packingslip form.No action done, while on key press . When we moves the pointer from that field to another then only the validation starts. Without using any tab or enter, while we hit any key, the validation should be active. Pl. give me the solutions.
Here is my code for your reference.
[FormControlEventHandler(formControlStr(CustPackingSlipJourEdit, CustPackingSlipJour_ShipCarrierWaybill), FormControlEventType::Validating)]
public static void CustPackingSlipJour_ShipCarrierWaybill_OnValidating(FormControl sender, FormControlEventArgs e)
{
FormRun formRun;
FormStringControl fsc;
//int strlen;
//int startPosition;
formRun = sender.formRun() as FormRun;
fsc = sender.formRun().design().controlName(formControlStr(CustPackingSlipJourEdit, CustPackingSlipJour_ShipCarrierWaybill));
str controlValue = fsc.text();
TextBuffer txt = new TextBuffer();
txt.setText(controlValue);
txt.regularExpressions(true);
if(!txt.find("^[0-9]+$"))
{
throw error("@DT:TrackingNumber");
}
}
Thanks in Advance,
Prasad N.