How do I make sure that an edit box is not empty?Answer This how-to can be implemented only in an Enterprise project.
Some fields in the dialogs of your installation package may
need to be filled in order to run the install successfully. You can make
sure that the end-user will fill a field by using a small custom action
and the property of the field. For an edit box control which has the property
MY_EDIT, you can follow these steps: - go to the Dialogs page and
create a custom dialog (or modify an existing one)
- on the custom dialog create an edit box control
- while the edit box is selected, set the Property Name
field in the Properties pane to
MY_EDIT
- go to the Custom
Actions page
- under UI Custom Actions create a new
ScriptInline custom action
- set the Script Text field to something like
this:
MsgBox "This field cannot be empty. Please enter a value in it" - go to the "Dialogs" page and select the Next button
on your custom dialog
- go to the Published Events tab in the "Control"
section
- double click the NewDialog control event
- set its condition to MY_EDIT (the control
event will run only if the "MY_EDIT" property is not empty)
- create a DoAction control event which looks like
this:
DoAction ScriptInline NOT MY_EDIT "ScriptInline" from the above DoAction control event represents the
UI custom action which shows the custom message box.
The NOT MY_EDIT condition for the "DoAction"
control event will run the message box custom action only if the
property of the edit box is empty.
|