This topic contains 1 reply, has 2 voices, and was last updated by  ivailo 9 years, 5 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • change event not firing #73540

    omargarro
    Participant

    I have this situation: jqxNumberInput object plus a jqxInput object

    I want to update jqxInput object value on NumberInput textchanged event. That works fine.
    But I also want to do something on jqxInput change event. And that is not working:

    If you take a look at my code below, what I’m not getting is the “Hey.. I’ve changed!” message as I spin the jqxNumberInput object.

    You might think why not doing it all on “textchanged” event. The answer is because the script logic is so much complex. ( #result is updated from various other objects as well)

    my code:

    
    

    <script type=”text/javascript”>
    $(document).ready(function () {
    $(“#result”).jqxInput( {width: ’90px’, height: 28, searchMode: ‘none’ } ).prop(“readonly”, false).on(‘change’, function() {
    alert(“hey… I’ve changed!”);
    });

    $(“#jqxNumberInput”).jqxNumberInput({
    min: 0,
    width: ’90px’, height: 28,
    spinButtons: true,
    textAlign: ‘right’,
    decimalDigits: 2,
    inputMode: ‘simple’
    }).on(‘textchanged’, function(){
    $(“#result”).val( $(this).val() );
    });
    });
    </script>
    </head>

    <body>

    <div id=”jqxNumberInput”></div>

    <br/><br/>
    <input type=”text” id=”result” />

    </body>
    `

    change event not firing #73547

    ivailo
    Participant

    Hi omargarro,

    The event is triggered from the blur event of the input and is the default behavior of the HTML input.
    So like a workaround you can trigger the event with the trigger() function.

    Here is the demo.

    Best Regards,
    Ivailo Ivanov

    jQWidgets Team
    http://www.jqwidgets.com

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

You must be logged in to reply to this topic.