I have make a one page in which I have used the KendoUI treeview control and its data is posted by an AJAX call, and there is also form data. Currently I have a separate buttons for the AJAX call and for posting the form, now I want to post form data and also perform the AJAX call on single button.
I have tried to make a jQuery function which triggers both buttons on a single click. I have made another button which has a click event:
<input type=submit onclick="BtnClick" /> <-- on click function call
javascript function:
function BtnClick() {
$("#Submit").click(); <-- Submit ajax call
$("#Save").click(); <-- post form
}
In the above function, the AJAX call is going and on same time page is also posting so the AJAX call is not completing.
How can I get this functionality by a single click?
Please advise.