Hi,
Could anybody help me?
We have a object with workflow actions/status and status pages.
What i want is to create a custom button that execute my function without submitting the form.
i found an example to create a button i.e.
<button onclick="myFunction()">Click me</button>
<script>
function myFunction(){
alert("Welcome");
}
</script>
in the above example the function is executed. But after that the form is submitted.
Is there any way to prevent the form submitting when there is a custom button on a Status page?
Thanks in advance
Jorrit
Hi Murali,
no still after the message the form is submitting.
regards Jorrit
Hi Jorrit,
The onlick handler should return false for the event not to propagate & prevent default action. Can you please try out the below snippet,
<button onclick="return myFunction();">Click me</button>
<script>
function myFunction(){
alert("Welcome");
return false;
}
</script>
Hi Murali,
Managed to get it work with kendo:
<button id="button" type="button">Click me</button>
<script>
$("#button").kendoButton();
var button = $("#button").data("kendoButton");
button.bind("click", function() {
function();
});
</script>
thanks for the help.
regards Jorrit