You could use the confirm button instead of alert. This way you can add an onclick event for when the user presses ok. Using the example from the link, instead of ...
require([
"jquery",
"splunkjs/mvc/simplexml/ready!"
], function(
$
) {
$("#btn-submit").on("click", function (){
alert("Yahoo!");
});
});
you could have ...
require([
"jquery",
"splunkjs/mvc/searchmanager",
"splunkjs/mvc/simplexml/ready!"
], function(
$,
SearchManager
) {
var mysearch = new SearchManager({
id: "mysearch",
autostart: "false",
search: "index=_internal | stats count by sourcetype"
});
$("#btn-submit").on("click", function (){
var ok = confirm("Yahoo!");
if ( ok==true ){
mysearch.startSearch();
} else {
alert('user did not click ok!');
}
});
});
... View more