Sreeram
Posts: 26
Joined: Mon Aug 17, 2015 12:19 pm

Set default value to Textbox2 based on Textbox1

Hello Team,

I have two text boxes, Textbox1 & Textbox2.

If Textbox1 - enabled = True, set Textbox2 value to empty.
If Textbox1 - enabled= false, set Textbox2 value to "ABC(some string)".

Kindly help me on this

Regards
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Set default value to Textbox2 based on Textbox1

Hi,

You can achieve this by using the Set installer property published event.

However, the Edit Box control does not support Published Events. By the way, what decide if the Textbox1 is enabled or disabled? Can you please give us more details so I can have a better view about your scenario?

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Sreeram
Posts: 26
Joined: Mon Aug 17, 2015 12:19 pm

Re: Set default value to Textbox2 based on Textbox1

Look, i am having a dialog with a radio button group having two radio buttons and two text boxes.

If radbtn1 is selected textbox1 will be disabled.
If radbtn2 is selected textbox1 will be enabled.

Now the requirement is,

if radbtn1 is selected, textbox1 should be disabled and the default value to textbox2 should set to "ABC(some string)"
if radbtn2 is selected, textbox1 should be enabled and the default value to textbox2 should set to " (empty)"

As radio button group doesn't have the option of setting value to textbox, i preferred to work based on textbox enable & disable

kindly do the needful.

Regards
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Set default value to Textbox2 based on Textbox1

Hi,

As I said, the radiobutton group does not support published events. In this case, you should use checkbox controls and simulate the radiobutton group functionality. For details, please take a look on the Set value according to selection RadioButtonGroup forum thread which present this solution. Also, you will find a sample implementing a similar scenario.

Should there be any difficulty you encounter implementing something, please do not hesitate to contact me and I will gladly assist.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Sreeram
Posts: 26
Joined: Mon Aug 17, 2015 12:19 pm

Re: Set default value to Textbox2 based on Textbox1

Yes, i have gone through the link. But the requirement is to use only radio buttons Please find the below actual scenario


Here the requirement is

if user selects Windows Authentication, the "UserName" textbox value should be set "(some string)".
if user selects SQL Authentication, the "UserName" textbox value should be set " ".

Please go through the link which you have provided sample.

http://www.advancedinstaller.com/forums ... =2&t=30963

Kindly do the needful.

Regards
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Set default value to Textbox2 based on Textbox1

Hello,

Please note this is a Windows Installer limitation. The Radio Button Group control does not support publish events.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”