How to validate Jquery UI auto complete filed. Im using bootstrapvalidator to validate filed.I tried with this code its not working.

$('#f_flying_from')
        .change(function (e) {
            $('#flights-tab-form').bootstrapValidator('revalidateField', 'f_flying_from');
        });

Recommended Answers

All 2 Replies

Can we see the rest of your code? I'm pretty sure you don't need the change function, or you can try the keyup function.

thanks for your responce. i fixed that.but the JS not work in Chrome and IE.?

//on change
$('#f_flying_to,#f_flying_to_2')
        .change(function (e) {
            $('#flights-tab-form-2,#flights-tab-form').bootstrapValidator('revalidateField', 'f_flying_to');
        });

        //autocomplete
         $(".autocomplete").autocomplete({
        source: "list.php",
        minLength: 3,
        autoFocus: true,
        scroll: true,
        messages: {
            noResults: '',
            results: function () {
            }
        },
        close: function () {
            $(this).blur();
        }
    }).focus(function (event, ui) {
        $(this).autocomplete("search", "");
    });
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.