watersco
Posts: 7
Joined: Mon Dec 11, 2006 6:45 am

Validating input on custom dialogs

Hi,

What is the best way to validate user input in custom dialogs? For example sometimes I need to verify that a text field wasn't left blank, or in other cases I might need to verify that the user entered a valid IP address. Do I need to create a vbs file for each dialog to do the validation?

How do I popup a message to the user saying that the validation failed?

Thanks,

Chris.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
How do I popup a message to the user saying that the validation failed?
You need to create a VBS custom action scheduled on "UICustomAction" section in the "Custom Actions" page.

To obtain a value of a property in a VBS custom action you can use this code:

Code: Select all

strValue = Session.Property("PROPERTY")
Also the error messages need to come from the VBS custom action. For example:

Code: Select all

MsgBox "Error - The name filed cannot be empty."
Hope this helps.

Best Regards,
Gigi
_______________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”