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 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2006
    Location
    Belfast, UK
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Multipule functions for a button

    Hey, I have very little experience when it comes to JavaScript, but what I want to do is; use a single button to hide a layer and open a pop up. Iím able to do both with separate buttons.

    Script I used in the head:
    <script type="text/javascript">
    <!--

    <script language="JavaScript" type="text/JavaScript">
    function popUp(URL) {
    day = new Date();
    id = day.getTime();
    eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=400,height=400,left = 440,top = 312');");
    }
    // End -->
    </script>
    Script I used in the layer:
    <input type="button" onclick="javascriptopUp('feedback.htm')" value="Yes">
    <input type="button" onClick="toggleBox('Layer1',0);" value="Yes">
    I want to make a "Yes" button that does both those functions, Iíve looked on the internet and Iíve been unable to find any help. So if anyone can help me, it would be great.

    Thanks

  2. #2
    Senior Coder
    Join Date
    Sep 2005
    Posts
    1,791
    Thanks
    5
    Thanked 36 Times in 35 Posts
    you can separate commands with ;s, something like:
    Code:
    <button onclick="foo();bar();">


 

Posting Permissions

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