Response title
This is preview!
// Assign handlers immediately after making the request,
// and remember the jqXHR object for this request
var jqxhr = $.ajax( "example.php" )
.done(function() {
alert( "success" );
})
.fail(function() {
alert( "error" );
})
.MyCustom(function() {
alert( "Item Already Exists In the List" );
})
.always(function() {
alert( "complete" );
});
}
<!--This is where I filter the ListBox (select) >> (option) elements via keystrokes -->
<!--Via jQuery on my Listbox control I add a css class so I can work with it here - class ".srcItem" -->
<script type="text/javascript">
$(document).ready(
function () {
var elemSrc = document.getElementById("<%=srcBox.ClientID%>");
$(elemSrc).find("option").addClass("srcItem");
}
);
</script>
<script type="text/javascript">
$(document).ready(
function () {
var $users = $('.srcItem');
$('#usrSearch').keyup(function () {
$users.show(); //THis is regular jQuery that works only in Chrome
return;
}
var val = $.trim($(this).val()).replace(/ +/g, ' ').toLowerCase();
//Below is regular jQuery that works only in Chrome
$users.show().filter(function () {
var text = $(this).text().replace(/\s+/g, ' ').toLowerCase();
return !~text.indexOf(val);
}).hide();
});
}
);
</script>
© 2013 jQuery Foundation
Sponsored by and others.