jQWidgets Forums

jQuery UI Widgets Forums Getting Started Cannot make a button work ??

This topic contains 2 replies, has 2 voices, and was last updated by  Ivo Zhulev 9 years, 2 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • Cannot make a button work ?? #82099

    BradleyJQ
    Participant

    Hi
    I was trying to implement a Polar chart, should have worked but didnt. Tried now to make a new project and just the button example to make sure the jquery is working but for some reason i cant even get that much

    This is an asp.net MVC View page (CSHTML) and i went from jquery 1.10 to the latest 2.x and double checked all of the references to the .js and .css files, put the button references into the divs? they display but dont work

    Is there some basic 1st step to get the system to work? just making a textbox work?
    thanks

    Cannot make a button work ?? #82100

    BradleyJQ
    Participant

    Here is the code that would not work. The button click event fired the alert, the jqxSubmitButton would never fire the alert.

    <script type="text/javascript">
    
                $("button").click(function () {
                    alert("button clicked");
                });
    
                $("#jqxSubmitButton").click(function () {
                    alert("button clicked");
    
                });
    
    </script>
    
            <div>
                <input style='margin-top: 20px;' type="Button" value="Submit" id='jqxSubmitButton' />
            </div>

    with the div after the code? didnt work. Put the div first, script after? works, I had tried the onformload() thinking it would run after the DOM was finished, one button made the alert the other didnt. well ok, Jquery.

    Cannot make a button work ?? #82143

    Ivo Zhulev
    Participant

    Hi, BradleyJQ

    In order for your jQuery code to work before the html code you must put it in $(document).ready(function () { });
    Here is an example:
    https://www.jseditor.io/?key=jqxbutton

    Best Regards,
    Ivo

    jQWidgets Team
    http://www.jqwidgets.com/

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.