Hide button after one click

Blair5
Tera Guru

I have a button on a form, that when clicked, a GlideDialogWindow pops up and a user can enter comments and submit. The button should only be clicked once, how can I make this happen?

- Is there a way to hide it after it's clicked one time?
- If not, is there an error message I can put on the button alerting the user that they can't click it again?

Thanks.

3 REPLIES 3

Mark Stanger
Giga Sage

This article shows you how you can hide buttons with client scripts. You should be able to modify your 'onClick' function in your UI action to hide itself.

http://www.servicenowguru.com/scripting/client-scripts-scripting/removing-form-buttons/


Would it be an 'onChange' client script?

function OnChange(){
//Remove the 'Submit' button
var items = $$('BUTTON').each(function(item){
if(item.innerHTML == 'Contact IT'){
item.hide();
}
});
}


Attached is a screenshot of the UI action and its script --- not sure where to put this in.


Put it in your showContactForm function in your UI action script.