I have a hyperlink on one of my pages like this:
I need to add this client side script:
How do I add this to the onClick of a <a href> tag? I have tried
This does not work, anyone have any ideas. Basically I want a msgbox asking for confirmation of the delete, if the user clicks no I need the hyperlink to stop and not process. If they click yes, the hyperlink finishes and deletes the record.
Code:
If Request.Cookies("Groups")("DomainAdmins") = "YES" Or Request.Cookies("Groups")("Med4_ITDept") = "YES" Then
Response.Write "<li><a onClick=""Del_OnClick()"" href=""../Information_Technology/Emp_Information.asp?CMD=Delete&ID=" & sID & "&" & uUrl & """>Delete</a><br>"
Response.Write "<li><a href=""../Information_Technology/Emp_Information.asp?CMD=Edit&ID=" & sID & "&" & uUrl & """>Edit</a><br>"
End If
I need to add this client side script:
Code:
<script language="vbscript">
Sub Del_OnClick
Dim intResp
intResp = MsgBox("Do you really want to delete this user?", vbYesNo,"Confirm Delete"
If intResp = vbYes Then
window.event.returnvalue = True
Else
window.event.returnValue = False
End If
End Sub
</script>
How do I add this to the onClick of a <a href> tag? I have tried
Code:
If Request.Cookies("Groups")("DomainAdmins") = "YES" Or Request.Cookies("Groups")("Med4_ITDept") = "YES" Then
Response.Write "<li><a onClick=""Del_OnSubmit()"" href=""../Information_Technology/Emp_Information.asp?CMD=Delete&ID=" & sID & "&" & uUrl & """>Delete</a><br>"
Response.Write "<li><a href=""../Information_Technology/Emp_Information.asp?CMD=Edit&ID=" & sID & "&" & uUrl & """>Edit</a><br>"
End If
This does not work, anyone have any ideas. Basically I want a msgbox asking for confirmation of the delete, if the user clicks no I need the hyperlink to stop and not process. If they click yes, the hyperlink finishes and deletes the record.