
mark.janson1.5524939891142327E12 asked a question.
Edit Control Validation
Hello
I want to add validation to dialog box so that when user clicks 'Next' button it prevents them continuing if 'Edit1' (a control on the form) is blank.
I have added two actions to the Next button behaviour:
1. Run custom action (Installscript) to display a message box on condition Edit1 = ""
2. NewDialog if Edit1 <> ""
Action 1 works fine, but action 2 never seems to execute even when Edit1 is not blank, so usercannot move on to the next dialog box.
Any suggestions please?
// case statement for NEXT button click in your dialog
case RES_PBUT_NEXT:
// Get the contents of the edit boxes.
// RES_EDITBOX is the control identifier for your Edit box,
// svEditText is a string to retrieve the input
CtrlGetText (szDialogName, RES_EDITBOX, svEditText);
// Verify that edit box has data.
if (StrLength(svEditText) = 0)) then
MessageBox ("Text field cannot be empty.", INFORMATION);
else
bDone = TRUE;
endif;
nResult = NEXT;