Wrox Programmer Forums
|
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 13th, 2007, 06:56 AM
Friend of Wrox
 
Join Date: Apr 2005
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Calling VBScript Function from javascript

Hi All,

I need to call a Vbscript function from a checkbox onClick event. The same needs to be done from a link <a href></a>


How can this be done. Normal function calling failed.
------------I had used---------------

<a href="javascript:void(0);" language=VBscript onclick="GenerateHTML(SomeParameter)">Generate</a>
-------------------------------------


Any help would do.
 
Old July 13th, 2007, 08:32 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Are you sure it's an issue with the way you call your function? Your example should work. The following code results in four links that all say Hello:
Code:
<html>
  <head>
    <script type="text/vbscript">

      Function SayHello()
        MsgBox "Hello"
      End Function

    </script>
</head>
<body>

  <a href="#" onclick="SayHello()">Click Me</a><br />
  <a href="vbscript:SayHello()">Click Me</a><br />
  <a href="javascript:void(0);" onclick="SayHello()">Click Me</a>
  <a href="javascript:void(0);" language=VBscript onclick="SayHello()">Click Me</a>
</body>
</html>
Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling javascript function from with in ASP kawal.singh Classic ASP Basics 1 July 4th, 2007 05:17 AM
Calling a javascript function from C# SebFr C# 0 November 3rd, 2006 12:05 PM
Calling vbscript function(passed value string) manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 0 May 7th, 2006 11:50 PM
Calling a .NET function from javascript jainnid General .NET 6 June 8th, 2005 04:54 AM
On calling javascript function only one value pops shoakat Classic ASP Components 4 April 24th, 2005 06:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.