change CommandButton img in javascript???

Last post 06-02-2005, 2:02 PM by aaauuummmm. 1 replies.
Sort Posts: Previous Next
  •  06-01-2005, 9:52 PM 7167

    change CommandButton img in javascript???

    I'm using  CreateCommandButton, but want to dynamically change the underlying img in javascript without having to do a call back to the server and reconstructing the button. 

    How???

  •  06-02-2005, 2:02 PM 7184 in reply to 7167

    Re: change CommandButton img in javascript???

    No worries.  I figured it out.  I created two command buttons and then wrote javascript to hide one or the other depending on the state.  The only trick was recognizing that the cute software will prepend a "cmd_" to the ID of the img tag of the command button.

    In short, the javascript to hide a button looks something like...

      document.findElementById('cmd_MyButtonCommand').style.display='none';

    and to restore

      document.findElementById('cmd_MyButtonCommand').style.display='';

    Is there a better way?


View as RSS news feed in XML