I have grid , in that gird , for particular record I'm keeping active/inactive status. this is the view of that status

when I click active button Its showing this alert message.

but when I click cancel button I cant stop the action which is going to be active status.
this is the html code snippet for this active/inactive buttons
@if (item.Status == true)
{
<button class="btn btn-xs active btn-primary" data-HEI_ID = "@item.HEI_ID" data-status = "true" onclick="confirm_active()">Active</button>
<button class="btn btn-xs inactiveColor btn-default" data-HEI_ID = "@item.HEI_ID" data-status = "false" onclick="confirm_inactive()">Inactive</button>
}
else
{
<button class="btn btn-xs btn-default" data-HEI_ID = "@item.HEI_ID" data-status = "true" onclick="confirm_active()">Active</button>
<button class="btn btn-xs inactiveColor btn-primary active" data-HEI_ID = "@item.HEI_ID" data-status = "false" onclick="confirm_inactive()">Inactive</button>
}
this is script part for the alert message
<script type="text/javascript">
function confirm_active() {
var retVal = confirm("Are you sure you want to change the status to Active?");
if (retVal == true) {
// do stuff
return true;
} else {
return false;
}
}
function confirm_inactive() {
var retVal = confirm("Are you sure you want to change the status to Inactive?");
if (retVal == true) {
// do stuff
return true;
} else {
return false;
}
}
How can I make workable cancel button