Skip to main content

Bug Tracker

Side navigation

#9814 closed bug (invalid)

Opened July 13, 2011 10:36AM UTC

Closed July 13, 2011 12:50PM UTC

autocomplete+focusout issue

Reported by: mebinmadackalil@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.4.4
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 (1)

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

resolution: → invalid
status: newclosed

Hi, this is the bug tracker. Please ask for programming help in the jQuery forum. Thanks!

http://forum.jquery.com/