treaz
13th March 2003 22:26 UTC
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:
Afrow UK
13th March 2003 23:22 UTC
As far as I know, this isn't possible.
Hopefully I'm wrong!?
-Stuart
Joel
13th March 2003 23:34 UTC
well, according to the Install Options Manual, yes you can.
Check the manual and the value "Flags" --> Disabled
Afrow UK
13th March 2003 23:51 UTC
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
Joel
13th March 2003 23:58 UTC
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:
deguix
14th March 2003 06:55 UTC
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.
treaz
14th March 2003 16:21 UTC
Thanks for all your responses. Guess I would have to find other ways to work around this.
;)
Afrow UK
14th March 2003 21:30 UTC
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