Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#7545 closed bug (duplicate)

autocomplete+focusout issue

Reported by: mebinthomas Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.autocomplete Version: 1.8.14
Keywords: Cc:
Blocked by: Blocking:

Description

I am using autocomplete as well as focusout events in a text box. focusout event is used to save the entered data in the text box if the data not present in the auocomplete list.

please refer my code:

'autocomplete


$(".textBankName").each(function () {

var temp = $(this).attr('id'); temp = temp.substring(temp.length - 1, temp.length); var GCId = 44; $(this).autocomplete('../Handler/ajaxPopulatePsoName.ashx?Id=' + GCId, { idHolder: "RightContentPlaceHolder_gvdATM_hdnBankName_" + temp }});

});


'focusout:

$(".textBankName").live('focusout', function (event) {

if ($.trim($(this).val()) != "") {

$("#RightContentPlaceHolder_lblMessage").text();

if ($(this).parent().find("input:hidden").val() == "") {

if (confirm("Do you want to add new bank: " + $(this).val())) {

var bName = $(this).val(); $.get('../Handler/ajaxAddBank.ashx?q=' + bName, function () { });

var idtoget = $(this).attr('id'); $("#" + idtoget).focus(1, function () {

$(this).parent().parent().find('.atmName').focus();

});

} else {

$(this).val(""); $("#RightContentPlaceHolder_lblMessage").text('Bank name is mandatory'); var idtoget = $(this).attr('id'); $("#" + idtoget).focus(1, function () {

$(this).focus();

});

}

}

}

using keyboard . the focusout event will work perfectly..without any error

but while using mouse for selection... unnecessarily invoking confirm box with message""Do you want to add new bank"" without checking whether the data is available in the list or not.

please let me know the possible solution for this.

thanking you all Mebin Thomas

Change History (2)

comment:1 Changed 12 years ago by Scott González

Resolution: duplicate
Status: newclosed

comment:2 Changed 12 years ago by Scott González

Duplicate of #7484.

Note: See TracTickets for help on using tickets.