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

Thread: OnClick Button1

  1. #1
    New Coder
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    1
    Thanked 1 Time in 1 Post

    OnClick Button1

    Why is this line code not accessing "JavascriptProgram()"

    Code:
    <asp:Button ID="Button1" OnClick="return JavascriptProgram();" Text="Get Answer" runat="server" />
    The javascript program does not have any errors. The debug is flagging the Button1 button.

    Code:
    <script  type="text/javascript">
            function JavascriptProgram() {
                 code
            }
    </script>
    Last edited by Philosophaie; 07-03-2012 at 10:58 AM.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,354
    Thanks
    23
    Thanked 618 Times in 617 Posts
    I know nothing about asp. But in HTML the button tag should be:
    Code:
    <button>Some Text</button>
    and not
    Code:
    <button />
    If your checking things in IE. You might want to use
    Code:
    <input type="button" name="Button1" value="some text" onclick="JavascriptProgram();" />
    because IE sucks.


  •  

    Posting Permissions

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