Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/functions_content.php on line 661

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/functions_content.php on line 661

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/functions_content.php on line 661

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/functions_content.php on line 661

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 112

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/ubercode/public_html/forum/includes/bbcode.php on line 483
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3729: Cannot modify header information - headers already sent by (output started at /includes/functions_content.php:661)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3731: Cannot modify header information - headers already sent by (output started at /includes/functions_content.php:661)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3732: Cannot modify header information - headers already sent by (output started at /includes/functions_content.php:661)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3733: Cannot modify header information - headers already sent by (output started at /includes/functions_content.php:661)
ubercode.com • View topic - checkbox toggle

checkbox toggle

You have questions about Ubercode? Look here for your answers. You didnt find what you where looking for? Be the first to ask the question!

checkbox toggle

Postby onykage on Mon Oct 11, 2010 6:09 pm

how do you make a checkbox toggle on or off?

if you have a checkbox and you check it, and in the COMMAND-EVENT you have theControlObj set to disable another set of objects, how do you make then be re-enabled when the checkbox is unchecked?

i tried setEnabled(me.obj, TRUE) in the CHANGE_EVENT but nothing happens.

any suggestions?
onykage
Admin
 
Posts: 221
Joined: Sat Jan 03, 2009 8:28 pm
Location: Armpit USA
Programming languages: php, java, python, ubercode, easyuo, peril, cobal, pascal, ruby

Re: checkbox toggle

Postby ubercode on Tue Oct 12, 2010 5:13 pm

You're on the right track, but use the Command_Event to trigger the enabling or disabling of the other controls:

Code: Select all
   case COMMAND_EVENT =>
        if ControlObj = me.Checkbox1 then
          if GetValue(me.Checkbox1) = 1 then
            call SetEnabled(me.Edit1, true)
            call SetEnabled(me.Pushbutton1, true)
          else
            call SetEnabled(me.Edit1, false)
            call SetEnabled(me.Pushbutton1, false)
          end if
        end if


Also you can use the Load_Event to set the checkbox to initially checked: SetValue(me.Checkbox1, 1). To recap:

SetValue(me.Checkbox1, 1) - sets a check box
GetValue(me.Checkbox) - tests if a checkbox is checked or not
Command_Event - triggered when a checkbox changes
Change_Event - triggers when other things change (edit controls and scroll bars)
ubercode
Site Owner
 
Posts: 275
Joined: Sun Jan 04, 2009 3:46 pm
Location: UK Channel Islands


Return to Ubercode Questions

Who is online

Users browsing this forum: No registered users and 1 guest

cron