Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder ghostz00's Avatar
    Join Date
    Aug 2006
    Posts
    128
    Thanks
    11
    Thanked 2 Times in 2 Posts

    Using a one line function set to an onclick event.

    I figure this is possible somehow, my first thought was:

    PHP Code:
    <input type="button" value="myBtn" onclick="javascript:function(){ myfunction1(); myfunction2(); }" /> 
    That didn't work, but it didn't give me an error either ?????

    Also do I need the "javascript:"?

    Please critique away.

    thanks in advance...
    Greg

  • #2
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    2
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Do you need the anonymous function?

    I think you could just do...

    Code:
    <input type="button" value="myBtn" onclick="myfunction1(); myfunction2();" />

  • Users who have thanked jgadbois for this post:

    ghostz00 (08-30-2007)

  • #3
    Regular Coder ghostz00's Avatar
    Join Date
    Aug 2006
    Posts
    128
    Thanks
    11
    Thanked 2 Times in 2 Posts
    .....thanks jgadbois....

    that works perfectly...
    Greg


  •  

    Posting Permissions

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