Hello All,
I am trying to figure out a way to accomplish this. What I want is when the person places a check mark in the checkbox, two fields become enabled, if the check mark is unchecked, then the two fields become disabled.
So I provided a snip of the code below. The text filed called LocalCpPath and the button called btnLocalcpPath, I would like disabled by default, when the end user ticks off the cpLogsLocal checkbox, then the button and text field becomes enabled.
I have been toying with the on click envent for the check box without success. I guess my question would be, how change I change the disabled from 1 to 0 with a on click event?
Any help would be appreciated.
$main->AddTextfield(
-name=> "LocalCpPath",
-width =>100,
-height =>20,
-pos => [95,55],
-disabled=>1,
);
$main->AddButton(
-name=> "btnLocalCpPath",
-text=> "...",
-width =>30,
-height =>20,
-pos => [210,55],
-disabled=>1,
);
$main->AddCheckbox(
-name => "cpLogsLocal",
-text => "Copy Logs Local",
-pos => [210, 5],
-size => [100, 21],
);
sub cpLogsLocal_Click{
$main->AddTextfield(-LocalCpPath->disabled(0));
##the about doesn't work, just playing
}
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.