I have two function and I need to execut in one onClick. The first one is to confirm the submit, if the user press yes it should execute the second function. It is not working with me. Any help please.
below my code:
<Script>
function checkSubmit(){
if(confirm('Are you sure you want to submit the data?');)
sendData();
}
</Script>
The button:
<input type="submit" id="send_data" class="send_data" value="Send" onclick="checkSubmit()"/>
THANKS FOR ALL ^_^
You have it almost right. I think your semi-colon is messing you up in your if statement.
Check out this jsFiddle: