- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
button click functionality: how do I change the name of a button?
hi ,
i have added a show-hide button using buttonclick.js functionality...
require([
"splunkjs/mvc",
"splunkjs/mvc/simplexml/ready!"
], function(
mvc
) {
var defaultTokenModel = mvc.Components.get("default");
var submittedTokenModel = mvc.Components.get("submitted");
$("#showButton").click(function(){
defaultTokenModel.set("show_details","true");
submittedTokenModel.set("show_details","true");
});
$("#hideButton").click(function(){
defaultTokenModel.unset("show_details");
submittedTokenModel.unset("show_details");
});
});
...but the show button is displayed as Show
i want to change the name of the show button.
Is this possible?
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![niketn niketn](https://community.splunk.com/legacyfs/online/avatars/299862.jpg)
@Mohsin123, I hope this is with reference to one of my older answers to Create Button Switcher. If you read the thread carefully the example actually had two buttons Show and Hide and the toggle between showing hide or show button was created the Panel with depends
and rejects
attributes.
So the example was not changing the name of same button rather there were two buttons. Please describe your use case, in case you do not want two buttons and why.
| makeresults | eval message= "Happy Splunking!!!"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@niketnilay
i have used your code .
My question is the button name is show , right?
i want to change the button name from show to: "click to view percentage"
- Mark as New
- Bookmark Message
- Subscribe to Message
- Mute Message
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
![niketn niketn](https://community.splunk.com/legacyfs/online/avatars/299862.jpg)
@Mohsin123, if you just want to change the label of <html>
button input,
The following code:
<html>
<button id="showButton" class="btn">Show</button>
</html>
Should be changed to
<html>
<button id="showButton" class="btn">Click to view percentage</button>
</html>
| makeresults | eval message= "Happy Splunking!!!"
![](/skins/images/396DDBEEAC295EB5FEC41FF128E8AC0A/responsive_peak/images/icon_anonymous_message.png)