Lowercase and Uppercase with jQuery

I think you want to lowercase the checked value? Try: var jIsHasKids = $(‘#chkIsHasKids:checked’).val().toLowerCase(); or you want to check it, then get its value as lowercase: var jIsHasKids = $(‘#chkIsHasKids’).attr(“checked”, true).val().toLowerCase();

How to get a table cell value using jQuery?

If you can, it might be worth using a class attribute on the TD containing the customer ID so you can write: $(‘#mytable tr’).each(function() { var customerId = $(this).find(“.customerIDCell”).html(); }); Essentially this is the same as the other solutions (possibly because I copy-pasted), but has the advantage that you won’t need to change the structure … Read more

jQuery Scroll to bottom of page/iframe

If you want a nice slow animation scroll, for any anchor with href=”#bottom” this will scroll you to the bottom: $(“a[href=”#bottom”]”).click(function() { $(“html, body”).animate({ scrollTop: $(document).height() }, “slow”); return false; }); Feel free to change the selector.

How do I catch an Ajax query post error?

Since jQuery 1.5 you can use the deferred objects mechanism: $.post(‘some.php’, {name: ‘John’}) .done(function(msg){ }) .fail(function(xhr, status, error) { // error handling }); Another way is using .ajax: $.ajax({ type: “POST”, url: “some.php”, data: “name=John&location=Boston”, success: function(msg){ alert( “Data Saved: ” + msg ); }, error: function(XMLHttpRequest, textStatus, errorThrown) { alert(“some error”); } });

jQuery: what is the best way to restrict “number”-only input for textboxes? (allow decimal points)

If you want to restrict input (as opposed to validation), you could work with the key events. something like this: <input type=”text” class=”numbersOnly” value=”” /> And: jQuery(‘.numbersOnly’).keyup(function () { this.value = this.value.replace(/[^0-9\.]/g,”); }); This immediately lets the user know that they can’t enter alpha characters, etc. rather than later during the validation phase. You’ll still … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)