Two buttons in a form, Both called

Posted by coffeeaddict on Stack Overflow See other posts from Stack Overflow or by coffeeaddict
Published on 2010-04-14T16:23:24Z Indexed on 2010/04/14 16:33 UTC
Read the original article Hit count: 189

Filed under:
|
|

Here's my ASP.NET form. When I click one button it calls both jQuery functions. It's probably a rudimentary HTML question but I'm not sure why:

<form id="form1" runat="server">
    <div id="testDialog">
    </div>

    <p><input type="button" id="invoke1" value="test 1" /></p>

    <input type="button" id="invoke2" value="test 2" />
</form>

<script type="text/javascript">
    $(function() {
        $("input:invoke1").click(function(){
            showSomething("testDialog");
        });

        $("input:invoke2").click(function(){
            showSomething2("test.aspx", options);
        });
    });
</script>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about html