Jeroen
Posts: 4
Joined: Thu Nov 29, 2018 12:03 pm

Additional validation in TextBox

Hello,

I'm working with AI-Architect. And I'm having trouble achieving something which I think at this point is not possible the way I want it to :P

I'm installing some IIS sites and I need to add a binding for the sites so they can be accessed.
The port for this binding needs to be set by the installing user, since we don't know their infrastructure.

I have a textbox now where I can only fill in 5 integers with {5}. But now I would like to give some kind of range to the port number.
So users can input anything between 1 and 65535. But I can't find any function that would support this in the TextBox itself.

Anyone got any ideas on how to achieve this? I sure can't be the first one ;)
Catalin
Posts: 6592
Joined: Wed Jun 13, 2018 7:49 am

Re: Additional validation in TextBox

Hello and welcome to our forums,

You can do the validation (the value introduced in the TextBox must be between 1 and 65535) by using a custom action then you can trigger that custom action from the "Next" button of your dialog (the dialog which contains the TextBox control). In that custom action, you should be setting a property have two values, which you can further use as conditions. For instance, you can set a property to either have one of the following values:

- 0 - if the input given by the user does not meet your requirements.

- 1 - if the input given by the user does meet your requirements.

Then, based on that, you can use our predefined "MessageBox" custom action, so you can let the user know that he used either a value lower than 1 or a value higher than 65535.

For more information about how to trigger a custom action when a button is pushed, please have a look on our "How to execute a custom action when a button is pushed" article.

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”