I have searched for this and didn't find anything real helpful. Basically I have a ASP page that just loops through a recordset and writes the row. At the end of each row is a DELETE hyperlink that pops up a message box confirming the delete (see code below). Is it possible to pass the recordset value (i.e. RS.fields("FirstName") & " " & RS.fields("LastName")) to the client side script so I can display it in the message box? Or is it just easier to make the delete hyperlink point to another page that has only the record to be deleted listed? The code in red is where it is writing the DELETE hyperlink, can I pass the field value from there?
And the code creating the rows and link:
Code:
<script language="vbscript">
Sub Del_OnClick()
Dim intResp
intResp = MsgBox("Do you really want to delete this record?", vbYesNo,"Confirm Delete")
If intResp = vbYes Then
window.event.returnvalue = True
Else
window.event.returnValue = False
End If
End Sub
</script>
And the code creating the rows and link:
Code:
Response.Write "<tr class=""TDBody"">"
If IsNull(RS.Fields("LoggedDate")) Then response.write "<td> </td>"
Else
Response.Write "<td>" & RS.Fields("LoggedDate") & "</td>"
End If
response.write "<td>" & RS.Fields("FirstName") & "</td>"
If isnull(RS.Fields("MiddleInitial")) Then Response.Write "<td> </td>"
Else
Response.Write "<td align=""center"">" & RS.Fields("MiddleInitial") & "</td>"
End If
Response.Write "<td>" & RS.Fields("LastName") & "</td>"
If IsNull(RS.Fields("Other")) Then response.write "<td> </td>"
else
response.write "<td>" & RS.Fields("Other") & "</td>"
End If
If isnull(RS.Fields("SignedCopy")) Then
Response.Write "<td> </td>"
Else
Response.Write "<td>" & RS.Fields("SignedCopy") & "</td>"
End If
If isnull(RS.Fields("AOBDate")) Then
Response.Write "<td> </td>"
Else
Response.Write "<td>" & RS.Fields("AOBDate") & "</td>"
End If
Response.Write "<td>" & RS.Fields("SalesRep") & "</td>"
Response.Write "<td><a class=""popup"" href=""javascript:pop('Diabetics_Notes_Popup.asp?ID=" & RS.Fields("ID") & "&" & uUrl & "')"">Notes</td>"
[COLOR=red]
If Request.Cookies("Groups")("Med4PodLeaders") = "YES" Then
Response.Write "<td><a style=""text-decoration: none; color: navy; font-size: 8pt"" href=""Diabetics_Main.asp?CMD=Edit&ID=" & RS.Fields("ID") & "&" & uUrl & """>Edit</a></td>"
Response.Write "<td><a onClick=""Del_OnClick()"" style=""text-decoration: none; color: navy; font-size: 8pt"" href=""Diabetics_Main.asp?CMD=Delete&ID=" & RS.Fields("ID") & "&" & uUrl & """>Delete</a></td>"
Elseif Request.Cookies("Groups")("DomainAdmins") = "YES" Then
Response.Write "<td><a style=""text-decoration: none; color: navy; font-size: 8pt"" href=""Diabetics_Main.asp?CMD=Edit&ID=" & RS.Fields("ID") & "&" & uUrl & """>Edit</a></td>"
Response.Write "<td><a onClick=""Del_OnClick()"" style=""text-decoration: none; color: navy; font-size: 8pt"" href=""Diabetics_Main.asp?CMD=Delete&ID=" & RS.Fields("ID") & "&" & uUrl & """>Delete</a></td>"
Elseif Request.Cookies("Groups")("Med4_ITDept") = "YES" Then
Response.Write "<td><a style=""text-decoration: none; color: navy; font-size: 8pt"" href=""Diabetics_Main.asp?CMD=Edit&ID=" & RS.Fields("ID") & "&" & uUrl & """>Edit</a></td>"
Response.Write "<td><a onClick=""Del_OnClick()"" style=""text-decoration: none; color: navy; font-size: 8pt"" href=""Diabetics_Main.asp?CMD=Delete&ID=" & RS.Fields("ID") & "&" & uUrl & """>Delete</a></td>"
End If
Response.write "</tr>"
RS.MoveNext
[/color]