I am new to JavaScript. I cannot find the error of this code.
<td class="paid">
<a href="invoice.php?id=<?php echo $invoice_result['id']; ?>" onclick="confirm()">
<img src="images/view_3.gif"/>
</a>
</td>
<script type="text/javascript">
function confirm() {
if (confirm("Do you realy want do delete this vehicle?")) {
return true;
} else {
return false;
}
}
</script>
help me to find my error..
Please check with this
<td class="paid"><a href="invoice.php?id=<?php echo $invoice_result['id']; ?>" onclick="confirmChk()"><img src="images/view_3.gif"/></a></td>
<script type="text/javascript">
function confirmChk(){
if(confirm("Do you realy want do delete this vehicle?")){
return true;
}
else{
return false;
}
}
</script>
NB:The problem was with your function name I changed it confirm to confirmChk