Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with confirmation with a link

Status
Not open for further replies.

DataSpy

Technical User
Nov 15, 2002
39
0
0
US
Help asking for confirmation from a link not a form. The only thing I can find is confirmation for a form. Any help would be greatly appretiated, thanx in advance, and yes I already searched google.

old code I was using for the form but I don't know how to switch it to a link. I moved the onclick to the link though.
Code:
<script language="JavaScript" type="text/javascript">
<!--
function confirmSubmit(){
title=window.document.delete.id.value
var agree=confirm("Are you sure you want to delete " + title + "?");
if (agree)
   return true;
else
   return false;
}
//-->
</script>
<body>
<a href="delete.php?id=$row[id]" onClick="return confirmSubmit()" class="style1">$row[etitle]</a>
 
You don't really need a seperate function - you can do this inline:
Code:
<a href="foo" [COLOR=red]onclick="return(confirm('your message here'));"[/color]>bar</a>

---
Marcus
better questions get better answers - faq581-3339
accessible web design - zioncore.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top