I have a js confirmation function:

function r_u_sure(message, url){
if(confirm(message)) location.href = url;
}

if I were calling this function with a regular href, I would use the following:

<a HREF="javascript:r_u_sure('Are Sure You want to Delete or Modify Car Information?!','www.somewhere.com)"><a/>

however my html link which begins the deletion process of a records opens a popup box that performs. the link is the following:

<a onmouseover='this.style.cursor=\"pointer\" ' onfocus='this.blur();' onclick=\"document.getElementById('PopUp10').style.display = 'block' \"><span><img border='0' src='../images/editcar_info.png' width='40' height='40' title='Delete or Modify Car'></span></a>

Any thoughts on how can conbine both so that onclick of the link, first, the confirm box appears, if "ok" is selected, the pop up box will open, else the dialogue box closes and nothing happens.

Mossa--

never mind, issue resloved! here is a working solution for anyone with similar problem

<style type="text/css">
.modify{
border:0;
cursor:pointer;
}
</style>

<script type="text/javascript">
//* <![CDATA[

function r_u_sure(message){
if(confirm(message)){
document.getElementById('PopUp10').style.display = 'block' ;
}
}

//*/// ]]>
</script>

and then for the link inside the body tag:

      <a onclick="r_u_sure('Are Sure You want to Delete or Modify Car Information?!');" ><span><img class="modify" src='../images/editcar_info.png' width='40' height='40' title='Delete or Modify Car'></span> </a>
<div id="PopUp10" style="display:none;"><a href="www.somewhere.com">Delete or Modify Car Information</a></div>

best!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.