PDA

View Full Version : VBScript: Text execution.


Morgoth
03-10-2003, 04:39 AM
Well, I figured ASP/VB ment some people in here might know Vbscript.

I am having a problem with my lack of VBscript knowledge and basically, what I want to do is probibly not possible with VBscript, but is with javascript.

I want to have it so, when a <a> tag (text link) is clicked, it will execute "Sub delete_onClick". It then asks itself, if it equals 6 ("yes"), then it will link to a link in which I need a Variable to be taken out of a "value" or something and placed in the spot of "VarID".

Can I do this with a text link (<a> tag)? Can I do this with VbScript?



<script language="VBScript">
Sub delete_onClick
If MsgBox("Are you sure you wish" & vbCrLf & "to delete this comment?",52,"Delete Comment?") = "6" Then
window.location="delete.asp?type=delete&ID=" & VarID & "&delete=true"
End If
End Sub
</script>

<a href="#" name="delete" value="MyID">

Morgoth
03-10-2003, 04:44 AM
If this shouldn't be in the ASP forum, please move it whammy.

Morgoth
03-10-2003, 09:05 AM
Never mind, I decided not to do it with any client side, real time scripts.

whammy
03-11-2003, 01:16 AM
Well actually you can do that with .NET rather easily (although .NET is not easy to learn at first, and as I have limited time to study it I'm still figuring it out!). ;)

However to do it on the client-side with normal ASP, I'd definitely use javascript instead (you could update an invisible image with javascript to point to an ASP script on the server which deleted the comment by the "commentId" or something, it's a cheap but workable way to do (limited to one way, out (or is it? haven't messed with it enough)) remote scripting).

Morgoth
03-11-2003, 04:46 AM
Well, VBscript..
It was an idea, but I decided it would be better not to have that popup alert.. the noise is just so.. grr...
Makes your head hurt. ;)