Showing posts with label JQuery. Show all posts
Showing posts with label JQuery. Show all posts

Monday, October 10, 2011

Focus on textbox

    $(document).ready(function () {
         $("#cphPageContent_CtlAddandEditProject1_txtTitle").focus();
     });

Wednesday, May 25, 2011

Selecting checkboxlist type on checkbox checked on OnAutoPostback=true

On pageload
-------------------
$(document).ready(




}

{
function () {var "input[id*='chkSelectAll']");if ("checked")) {"input[id*='chlTypeList']")."checked", "checked");"input[id*='chlTypeList']")."disabled", true);else //$("input[id*='chlTypeList']").removeAttr("checked");
}
});

SelectAll Checkbox
---------------------------




}



}
}
"input[id*='chlTypeList']")."disabled", false);function if ("checked")) {"input[id*='chlTypeList']")."checked", "checked");"input[id*='chlTypeList']")."disabled", true);else {"input[id*='chlTypeList']")."checked");"input[id*='chlTypeList']")."disabled", false);attr($(removeAttr($(attr($(attr($($(Check).attr(ChangeCheckboxlist(Check) {attr(
$(
attr(
$(
attr(
$(
$(Check).attr(
Check = $(

Friday, May 20, 2011

Limiting the No. of Characters in TextBox using JQuery

1. In aspx page:
<div>
<div>
<asp:ImageButton ID="imgAddCommentUser" CommandName="AddReply" runat="server" />
<asp:TextBox ID="txtReplies" runat="server" TextMode="MultiLine" onKeyUp="textCounter(this.id);"Text="Write a replies..."></asp:TextBox>
</div>
<div class="clear">
</div>
<div style="float: right; padding: 0 0 0 50px; *margin-top: -15px;"><span id="spanLeftChar" runat="server">
<small>4000 characters left</small>
</span>

In Jquery.js
---------------
eg: 4000 characters


 
        var spanObj = $(txtId).parent().next().next().children("span:first");       

        len = $(txtId).val().length;
        
        if (len > limit)
            $(txtId).val($(txtId).val().substring(0, limit));


      if((limit - len)>=0)
          $(spanObj).html("<small>" + (limit - len) + " characters left </small>")
        else
            $(spanObj).html("<small>0 characters left </small>")
    }

    function textCounter(txtId)
     {            
        var limit = 4000;
        var txtId = "#" + txtId;

Monday, March 28, 2011

Password Strength Validator

Hi Guys,

 We often need to have a password validator where the user needs to be intimated about the strength of the password which they have entered so that the user can be aware about their password.

This can be easily done with the help of Jquery.

You can email me for the sample code.

Resource: http://simplythebest.net/scripts/ajax/ajax_password_strength.html