Results 1 to 4 of 4

Thread: Functional Hyperlink

  1. #1

    Thread Starter
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303

    Question Functional Hyperlink

    When I click on a Hyperlink how can I get it to run some VB script first?

    I know it must have something to do with OnClick, but not sure how to call the function
    Thanks in advance for any help provided.

    VB 6 Enterprise Edition SP4
    ADO, SQL 7/2000, ASP and some JavaScript


    >> Life goes on, but for how long? <<
    If you can smile when things go wrong, you have someone in mind to blame

  2. #2
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Is this what you want?

    Code:
    <html>
    <head>
    <script language=Javascript>
    function x(){
    alert("hfgpiusargpufnpg");
    }
    
    
    </script>
    </head> 
    
    <body>
    <A href="page2.html" onClick="x()">page2</a>
    
    </body>
    </html>
    Mark
    -------------------

  3. #3

    Thread Starter
    Hyperactive Member parkes's Avatar
    Join Date
    Jan 1999
    Location
    Unitied Kingdom
    Posts
    303
    Thanks but would it be the same for VBScript?

    <html>
    <head>
    <script language=vbscript>
    function x()
    'do something
    end function

    </script>
    </head>

    <body>
    <A href="page2.html" onClick="x()">page2</a>

    </body>
    </html>
    Thanks in advance for any help provided.

    VB 6 Enterprise Edition SP4
    ADO, SQL 7/2000, ASP and some JavaScript


    >> Life goes on, but for how long? <<
    If you can smile when things go wrong, you have someone in mind to blame

  4. #4
    Frenzied Member Mark Sreeves's Avatar
    Join Date
    Nov 1999
    Location
    UK
    Posts
    1,845
    Yep!

    ... but I prefer to use javascript in the browser rather than vbscript
    Mark
    -------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width