|
|
#1 |
|
Junior Member
Join Date: Aug 2006
Posts: 20
|
if checked, then disable a "Field"
Hi.
I have a custom Page. In this Custom Page, there are some Fields (Label, Text, Password) and Checkbox. Now I want to do, that, when a checkbox is checked, then an of the Fields (Text) should be disabled! Lood at the Picture "enabled&disabled.jpg" Thx @all PHP Code:
|
|
|
|
|
|
#2 |
|
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
First, make sure you have the notify flag set on your checkbox. Then, in the page's callback function, so this: (PS: your original code was missing a backslash between $PLUGINSDIR and the name of your page file.)
code: ***EDIT: I changed the code above to check for the state of the checkbox and enable/disable as needed. (minor details...) |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Aug 2006
Posts: 20
|
sorry, but i don't understand, where I should give the function "callback"?
This my Code now ... Field 16 is my checkbox and Field 12 and 14 must be disabled, when this checkbox ist NOT checked. Do you know, what i mean? code: I don't forget "/" ... but the editor of PHP doesn't show it. |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
Any custom page you insert has a show function and a leave function (also called a callback function).
Use them in your page command like this: code: (in this example, the "leavefunction" is what I'm calling the "callback" function.) Refer to the documentation and the examples for more info. (${NSISDIR}\examples\InstallOptions\testnotify.nsi offers a good example of how to use page callbacks.) |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Aug 2006
Posts: 20
|
Thx a lot man!!!
it workssss!!! FALSE: "$PLUGINGSDIR" RIGHT: "$PLUGINSDIR" |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Aug 2006
Posts: 20
|
What does this text mean??
code: It works with to disable an Field, but i cant continue with the install. What is the problem?? code: Now last question...how can I "disable" more Fields?? I want to disable Filed 12 and 14. Last edited by OsmanY22; 25th August 2006 at 13:20. |
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Jan 2005
Location: Oregon Coast
Posts: 737
|
oops! My bad..
It was a typo on my part--sorry 'bout that! The line code: should have been: code: And thanks for catching my other typo. Edit: OsmanY22, I sent you a PM explaining the nuts and bolts of this script a little better so that you'd have a better understanding of how to implement it in your situation. Last edited by Comperio; 26th August 2006 at 14:18. |
|
|
|
|
|
#8 |
|
Junior Member
Join Date: Jun 2006
Location: Brisbane, Australia
Posts: 12
|
Please can someone help me! I have a custom page with 2 fields. a checkbox (field 2) and a text box (field 4)
I want to make it so if the checkbox is ticked, the textbox is enabled, and if unticked the textbox is disabled. I have followed code snippets from this forum and yet cannot make it work. I know I am close! Any helpers? Thanks! code: |
|
|
|
|
|
#9 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,338
|
ReadIniStr requires a full path. Use $PLUGINSDIR\optionDetails.ini or the MUI macros. Same goes to WriteIniStr.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Jun 2006
Location: Brisbane, Australia
Posts: 12
|
Thanks very much kichik! That fixed it for me!
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|