Is there a way to trigger two functions with just one button click? I want the button to execute the check() function and open a popup window with a PHP script. I've tried different approaches but none have been successful. Can anyone assist me?
<input class="btn btn-primary" type="button" value="Save and Continue" onClick="OpenWindows(); return check();" />
Here is the code for the check() function:
function check(){
var input, filter, ul, li, a, i;
input = document.getElementById("customer_idSet");
filter = input.value;
ul = document.getElementById("customer_list");
li = ul.getElementsByTagName("li");
for (i = 0; i < li.length; i++) {
a = li[i].getElementsByTagName("sup")[0];
if (filter == a.innerHTML) {
return true;
}
}
alert("Please select the customer from dropdown or add a new customer");
return false;
}
I'm unsure how to trigger a popup from the Openwindows() function. Any suggestions?