Skip to main content

Search and Top Navigation

#7545 closed bug (duplicate)

Opened July 13, 2011 10:29AM UTC

Closed July 13, 2011 12:50PM UTC

Last modified July 13, 2011 12:50PM UTC

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

Attachments (0)
Change History (2)

Changed July 13, 2011 12:50PM UTC by scottgonzalez comment:1

resolution: → duplicate
status: newclosed

Changed July 13, 2011 12:50PM UTC by scottgonzalez comment:2

Duplicate of #7484.