SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2010
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    calling a sub (function) from onclick button

    Happy New Year.

    I am populating an html table with database records. Users may click on a check box and update one of the columns data. A button click will capture these data and update my table.
    So my questions is.. is it possible to call vbscript fuction on button onclick ?
    So it will be like but I get an error. What I am doing wrong?

    Any suggestion is greatly appreciated.

    <%
    Sub butnupdate
    response.write( "Help" )

    End Sub
    %>


    <input type="submit" name="updtcomment" value=" Update Comments" onclick="<%butnupdate%>">

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2010
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Found a way.
    Thank you.

  3. #3
    SitePoint Addict
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    377
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    like this:
    onclick="VBscript:myVBFunction('parameter')"
    http://bulevardi.be/?content=scripting&example=exvb1

  4. #4
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    686
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ASP runs on the server.

    onclick events run on the client.

    You can call a serverside function from the client via ajax.

    I recommend you discuss this in a javascript forum which is more applicable than here in ASP forum

  5. #5
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,035
    Mentioned
    187 Post(s)
    Tagged
    2 Thread(s)
    This thread started in ASP, moved to Javascript, then back to ASP

    In any event, I believe the OP's problem has been solved despite bulevardi posting a reply 3 weeks after the fact

    Quote Originally Posted by asp2008 View Post
    Found a way.
    Thank you.


Bookmarks

Posting Permissions

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