Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

how to disable and enable a button?

Moran1
Kilo Contributor

i have this button: 

<g:dialog_buttons_ok_cancel ok_id="submitdata" ok="return go_ok()" ok_type="button" ok_text="Run" ok_style_class="btn btn-primary" cancel_type="button" cancel_id="canceldata" cancel_style_class ="btn btn-default" cancel="return goCancel()"/>

and i am looking for a way to disable it and also a way to enable it later by using document.getElementById.

can someone tell me how to do those two things? 

1 ACCEPTED SOLUTION

Saurav11
Kilo Patron

You can use:-

  • document.getElementById("Button").disabled = true;
    
  • document.getElementById("Button").disabled = false;

 

Hope this helps. Please mark the answer as correct/helpful based on impact.

View solution in original post

2 REPLIES 2

Maik Skoddow
Tera Patron

Hi

please look into the underlying Heisenberg style guide. You only have to add/remove the respective CSS classes

https://hi.service-now.com/styles/heisenberg/styleguide/docs/components_-_buttons.html

Kind regards
Maik

Saurav11
Kilo Patron

You can use:-

  • document.getElementById("Button").disabled = true;
    
  • document.getElementById("Button").disabled = false;

 

Hope this helps. Please mark the answer as correct/helpful based on impact.