Archive: Dynamic Enable/Disable TextBox


Dynamic Enable/Disable TextBox
Hi,

I was just wondering if there is anyway to dynamically Enable and Disable Textboxes on Customised pages?

Basically, what I wish to do is to have a checkbox and Textboxes. Some of the text boxes should only be enabled when the user checks the Checkbox. If the user does not check it, the textbox should remain disabled. However, this enabling and disabling should NOT be dependent on click the next/back/cancel/install button.

Thanks.
:cool:


As far as I know, this isn't possible.

Hopefully I'm wrong!?


-Stuart


well, according to the Install Options Manual, yes you can.
Check the manual and the value "Flags" --> Disabled


He wants it to be disabled or undisabled only if the user turns it on and off with the check box opposite. That isn't possible.

Using Flags=DISABLE will perminantly disable it, unless you call a WriteINIStr command to remove the Flag, and then the user may go back to the page and it will nolonger be disabled.

-Stuart


Using Flags=DISABLE will perminantly disable it, unless you call a WriteINIStr command to remove the Flag, and then the user may go back to the page and it will nolonger be disabled.
It's a hard work in the scripting but maybe possible... I use in my
script a checkbox for detecting the file... if isn't there I cancelled
some textboxes... yea some long code for that and more... :igor:

This occours because the INI is refreshed only after you exit the page. The Install Options 2 don't support a "live page", that you can disable/enable a control by doing somenthing when the page is showing.


Thanks for all your responses. Guess I would have to find other ways to work around this.

;)


Instead of bothering about whether or not the DirRequest/FileRequest boxes and the CheckBox are enabled or not, why not just have it so that if the user turns the option on e.g. "Allow directory request", then it will use the DirRequest Field.

e.g.


ReadINIStr $1 "$INSTDIR\temp.ini" "Field 2" "State"
StrCmp $1 0 DoNotUse

#If Field 2 is selected, then the following will happen...
ReadINIStr $1 "$INSTDIR\temp.ini" "Field 3" "State" #Gets entered directory
SetOutPath $1
File "C:\myfiles\myfiles.*"

DoNotUse: #Skips extracting files


So, as long as the CheckBox was selected, then it will install files through the specified directory.
If the CheckBox was not selected, then the DirRequest box will mean and do nothing.

Hope that helps.

-Stuart