Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - call vb function on button click
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

call vb function on button click

 Post Reply Post Reply
Author
riya_singtel View Drop Down
Newbie
Newbie
Avatar

Joined: 14 March 2005
Location: India
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote riya_singtel Quote  Post ReplyReply Direct Link To This Post Topic: call vb function on button click
    Posted: 01 April 2005 at 3:01am
Is there a way i can call a Vb function on buttonclick.
what i am doing is
<Input type="button" value="Remove" OnClick="RCK()">
 
where RCK is written in vbscript as
<%
Function RCK()
    Response.Cookies("nm")=""
End Function
%>
 
using it this way gives an error:
')' Expected
 
I tried "call RCK()" but that too doesnt work
 
Thanks
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2005 at 3:25am
No you can not do that. Javascript is client side, your Vb function is server side.
Back to Top
riya_singtel View Drop Down
Newbie
Newbie
Avatar

Joined: 14 March 2005
Location: India
Status: Offline
Points: 30
Post Options Post Options   Thanks (0) Thanks(0)   Quote riya_singtel Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2005 at 3:36am
So how shd i do it? all i want is that the value of the particular cookie be deleted when i click that button.
if i use a client side vbscript function I have to use document.cookie, but that creates a duplicate cookie though with the same name and no value. what i used was:
 
   <SCRIPT LANGUAGE="VBSCRIPT">
      Sub RemoveCookie
                docu ment.cookie= "nm="
            End Sub
    </SCRIPT>


Edited by riya_singtel - 01 April 2005 at 3:38am
Back to Top
MadDog View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 01 January 2002
Status: Offline
Points: 3008
Post Options Post Options   Thanks (0) Thanks(0)   Quote MadDog Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2005 at 3:38am
If you wanted to use ASP you would just set the cookie = "" then when the browser is closed the cookie is deleted.

With javascript... i have no clue. Try Google.com

Like i like to say when i have no idea, Google is your friend!
Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2005 at 4:27am
<%
If Request.Form("remove") > "" Then
Response.Cookies("nm") = ""
End If
%>

<Input type="button" id="remove" value="Remove">
Back to Top
Paul Lush View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 24 September 2003
Status: Offline
Points: 59
Post Options Post Options   Thanks (0) Thanks(0)   Quote Paul Lush Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2005 at 9:53am
something like
<script>
function removecookie {
    document.cookie = ''
}
</script>

onlick=removecookie();

Back to Top
Mart View Drop Down
Senior Member
Senior Member
Avatar

Joined: 30 November 2002
Status: Offline
Points: 2304
Post Options Post Options   Thanks (0) Thanks(0)   Quote Mart Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2005 at 10:05am
That's javascript, he wants server side vbscript
Back to Top
Paul Lush View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 24 September 2003
Status: Offline
Points: 59
Post Options Post Options   Thanks (0) Thanks(0)   Quote Paul Lush Quote  Post ReplyReply Direct Link To This Post Posted: 01 April 2005 at 12:31pm
True, I shouldve read that better.

What Im doing for that is to target a 1x1 pixel IFRAME that has the cookie delete code, that avoids reloading the current page.

<input taget="iframwindow">
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.