Posts

Showing posts with the label Jquery

Display the Selected Text and Value of a Item in DropDownList using jQuery

Image
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server">     <title></title>     <script src="Scripts/jquery-1.7.1.min.js" type="text/javascript"></script>     <script type="text/javascript">         $(function () {             $('# DropDownList1 ').bind("change keyup", function () {                 $('# para ').html( "Value: " + $(this).val() + "<br />" + " Text: " + $('# DropDownList1 :selected').text());             });         });     </script> </head> <body>     <form id="form1" runat="server">     <div>         <asp:DropDownList ID=" DropDownList1 " runat="server">             <asp:ListItem Value="0">Item 0</asp:ListItem>             <asp:ListItem Value="1">Item 1</asp:Li

Check all checkboxes in GridView using jQuery

GridView Id = gvUserInfo CheckAll Box ID = chkHeader Checkbox ID= chkChild <script src="scripts/jquery-1.3.2-jquery.min.js" type="text/javascript"> </script> <script src="scripts/jquery-1.7.2-jquery.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function () { $("#gvUserInfo input[id*='chkHeader']").click(function () { $("#gvUserInfo input[id*='chkChild']").attr('checked', this.checked); }); // if all checkbox are selected, check the selectall checkbox // and viceversa $("#gvUserInfo input[id*='chkChild']").click(function () { if ($("#gvUserInfo input[id*='chkChild']").length == $("#gvUserInfo input[id*='chkChild']:checked").length) { $("