Yes that is the idea.
Here is some cleaned up syntax:
<script type="text/javascript">
function deleteUser(userID)
{
if(confirm('Are you sure you want to delete the user ID " + userID + " ?"))
{
submit to your delete page or delete via RPC
}
}
</script>
Then the onclick would simply adjust to have the user ID, but not be a link to anywhere - usually a button onclick or a blank link since the javascript submits for the delete (or you can simple have the link point ot the function)
<a href="javascript:deleteUse
SO the cold fusion writes the link including the user ID and the javascript is almost identical to what DrewKell posted
Main Topics
Browse All Topics





by: DrewKjellPosted on 2005-06-30 at 14:21:25ID: 14342545
in the onclick method you'd reference the javescript function. Something like this, don't quote the syntax cause its been a little while since I've used javascript.
ck Me</a>
<script>
function deleteUser()
var x = confirm('Are you sure you want to delete the user?')
if x == true
<!-- Delete user code -->
else
<!-- Don't delete the user. Which I don't think you need to do any processing in
but I could be wrong. -->
then in the onclick you'd go
<a href="action.htm" onClick="deleteUser()">Cli
Hope this helps. If you need clarification let me know.