Posts

Showing posts with the label Jquery

Phone Number Auto Increment Decrement Focus

Following Jquery functions are used to set focus on text box on max length and set focus to prev text box on click of backspace when length gets zero. $(function () { $('.phoneText,.AlternatePhoneText,.FaxText').keyup(function (e) { if (e.which == 8) { if ($(this).val().length == 0)  $(this).prev(':input').focus(); } else { if ($(this).val().length == $(this).attr('maxlength'))  $(this).next(':input').focus(); } }) })  

Jquery Ajax call, dont want to load from Cache.

To avoid loading data or content from cache when making Ajax call using Jquery, the following statement need to add in the document.ready block. $(document).ready( function () { $ . ajaxSetup ( { // Disable caching of AJAX responses     cache : false }); }); the above code will disable caching for Ajax response on the page.