0

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--

1
Contributor
1
Reply
4
Views
5 Years
Discussion Span
Last Post by mbarandao
0

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!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.