jQWidgets Forums

jQuery UI Widgets Forums Lists ComboBox Combobox validation onblur

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Combobox validation onblur #52790

    holyeddie
    Participant

    Hi,

    I want to have a validation of a combobox on the blur event. I had
    some trouble in getting this done and figured our that the reason
    is a the combobox not firing the blur event.

    $(“#combo”).jqxComboBox({ width: 200, height: 25, source: [‘Peter’, ‘Nancy’, ‘Anthony’] });
    // works
    $(“#combo input”).on(‘blur’, function(event) { console.log(‘blur’); });

    // does not work
    $(“#combo”).on(‘blur’, function(event) { console.log(‘blur’); });

    When using the “#combo input” selector the blur event fires even when
    I open the pull down which will bring up a validator message.

    Is it possible to set up a blur event on the combobox itsself?

    Regards
    Lars

    Combobox validation onblur #52826

    Peter Stoev
    Keymaster

    Hi Lars,

    The following: $(“#combo input”).on(‘blur’, function(event) { console.log(‘blur’); }); binds to the ComboBox’s Input field’s blur event. You can also check inside the event handler whether the ComboBox is opened by using its isOpened method. By doing that, you will ensure that there’s a blur for the widget.

    Best Regards,
    Peter Stoev

    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.