View Full Version : Validating Email Address
10-17-2006, 06:55 AM
Can anybody help me how to validate Email address entered in a edit control. I am looking for a normal validation which checks the "@" and "." charecters.
Thanks in Advance
10-17-2006, 11:16 AM
This should get you started [assumes basic MSI project (not InstallScript project)]:
Add rows in the "Behavior -> Events" view for the dialog that contains the edit control. Modify the 'Next' PushButton control's Condition statement for the NewDialog Event so that the condition evaluates the text (stored in the property associated with the edit control). See Conditional Statement Syntax - Substring Operators (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/conditional_statement_syntax.asp). I think you'll probably want to add a condition like: (MY_EDIT_CONTROL_VALUE><"@") AND (MY_EDIT_CONTROL_VALUE><".")
That will not allow the loading of the next dialog unless the condition is met.
You would also need to add a new row with an Event that notifies the user to change the value. There are several things you can do here (edit a text control on the current dialog, launch a custom action that displays a message box, spawn a new dialog, etc.). The new Event would need to have a condition syntax that is the opposite of the previous one: (NOT MY_EDIT_CONTROL_VALUE><"@") OR (NOT MY_EDIT_CONTROL_VALUE><".")
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.