Hi,
I've written a simple sub to delete a photo (linked to a specific success story) when clicking on a button underneath the photo:
This is an extract from the code in the body:
Here's the Sub:
This works perfectly in IE without RUNAT="Server" in the script tag, but it won't work in Netscape or Opera.
The moment I add RUNAT="Server" in the script tag, though, I get an error message: Type Mismatch 'DeletePhotoE'.
I'm not sure what could cause this: strSuccessStoryID is just an integer, and strAtt1 is a string, but I did put it inside '....'.
Any help to solve this will be appreciated!
I've written a simple sub to delete a photo (linked to a specific success story) when clicking on a button underneath the photo:
This is an extract from the code in the body:
Code:
<%
...................
strSuccessStoryID = rs("SuccessStoryID")
strAtt1 = rs("Att1")
.......................
%>
' rs("Att1") would hold a value such as pic1.jpg
<input type="button" value="Remove" language="VBScript" onClick="Call DeletePhotoE(<%=strSuccessStoryID%>, '<%=strAtt1%>')">
Here's the Sub:
Code:
<SCRIPT language="VBScript">
Sub DeletePhotoE(ID, Photo)
Dim rc, strAnswer
rc = MsgBox ("Are you sure that you want to delete this photo?", vbYesNo, "Sure?")
strAnswer = rc
If strAnswer = 6 Then
location.href = "photo_delete.asp?SuccessStoryID="&ID&"&Photo="&Photo&"&Submit=True"
End If
End Sub
</SCRIPT>
This works perfectly in IE without RUNAT="Server" in the script tag, but it won't work in Netscape or Opera.
The moment I add RUNAT="Server" in the script tag, though, I get an error message: Type Mismatch 'DeletePhotoE'.
I'm not sure what could cause this: strSuccessStoryID is just an integer, and strAtt1 is a string, but I did put it inside '....'.
Any help to solve this will be appreciated!

):