Validation of Textbox - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

kumarkiranc
Posts: 85
Joined: Tue Sep 18, 2007 6:49 am

Validation of Textbox

Iam having 2 textbox. In one text box user must enter only numbers and in another one user must enter only Alphabet Characters only. Without Enter any thing in this textbox user should not move to another Dialog Window.


Thanks
Kiran
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

The property value of the EditBox is not automatically refreshed when you type something in it. This is the Windows Installer behavior.

A workaround is to add a message box on the "Next" button to inform the user that the EditBox cannot be empty. In the "Custom Actions" page you create a "Script Inline" custom action under "UI Custom Actions" and in the "Script text" field you add this:

Code: Select all

MsgBox "The editbox cannot be empty!"
In the "Dialogs" page, under the "Published Events" tab for the "Next" button you should have this:

Code: Select all

SetTargetPath  APPDIR                 1
NewDialog      VerifyReadyDialog      AI_INSTALL AND EDIT
DoAction       ScriptInline           AI_INSTALL AND NOT EDIT
where EDIT is the property associated to the editbox.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
kumarkiranc
Posts: 85
Joined: Tue Sep 18, 2007 6:49 am

Validation of Textbox

Thanks for your early reply.

I need to validate the editbox. the user must only enter numeric value in that edit box.


Thanks
Kiran
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

You can do this by using a Masked Edit editbox in the "Dialogs" page. For it to accept only numerical values you need to set in the "Properties" page in the "Display" section the text: <####>, where each '#' stands for a digit (in this example the user can input only four digits)

If you want the user to input digits and letters then you can use '?' instead of '#'

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”