Here is some links & code snippets to fetch/reset different controls value using JQuery.
Reset Dropdownlist Value
(1) how to clear the dropdownlist values on button cick event? using jquery
Reset CheckBoxList Value
(1) jQuery: Checking or Unchecking All Checkboxes | The CodeUnit of Craig
(2) How To Check or Uncheck all checkboxes in jQuery
Check all Checkbox in Grid
(1) Check All Checkboxes in GridView using JQuery in Asp.Net
(2) Checking All Checkboxes in a GridView Using jQuery.com
Table Operation
(1) How to get a table cell value using jquery?
(2) Disabling a button inside a gridview using jquery
Calculate Age(1) javascript- Stack Overflow
(2) Age Calculation from Date of Birth Using Javascript/Jquery « Pankaj Lalwani’s Blog
(3) Jquery Age calculation on date
Code Snippet to reset/fetch control values
(1) Remove checked for CheckBox - $("#<%= CheckBox1.ClientID %>").removeAttr("checked");
(2) Set Value for TextBox - $("#<%= TextBox1.ClientID %>").val("");
(3) Set Value for Dropdownlist - $('#<%= DropDownList1.ClientID %>').val("");
(4) Reset all Dropdownlist of Form - $("select[id*=DDL] option[value=0]").attr('selected', true);
(5) Set Value for HiddenField - $("#<%= HiddenField1.ClientID %>").val("0");
(6) Uncheck All Checkboxes on Form - $("input[type='checkbox']").attr('checked', false);
(7) Check all checkbox in grid - $('#<%=Grid1.ClientID %> >tbody >tr >td >input:checkbox').attr('checked', true);
(8) Fetch table cell value - $('#mytable tr').each(function() {
var customerId = $(this).find("td").eq(2).html(); }
(9) Set confirm on link button in Grid -
$('#<%= Grid1.ClientID %> tbody tr').not(':first').each(function () {
$(this).find("a[id$=LinButton1]").click(function () {
return confirm('Are you sure you want to delete?');
});
});
(10) Create common function in jQuery - this function returns checked items count in grid
$.fn.gridCount = function () {
var vCount = 0;
$('#<%=GridView1.ClientID %> tbody tr').not(':first').each(function () {
var strVehicleID = $(this).find("td:first-child").find("input:checkbox");
if (strVehicleID.attr("checked") == true) {
vCount++;
}
});
return vCount;
}
(11) Some useful jQuery syntaxes
jQuery Selector
(12) Fetch Url attribute values
Get current page URL and title with jQuery
(6) Uncheck All Checkboxes on Form - $("input[type='checkbox']").attr('checked', false);
(7) Check all checkbox in grid - $('#<%=Grid1.ClientID %> >tbody >tr >td >input:checkbox').attr('checked', true);
(8) Fetch table cell value - $('#mytable tr').each(function() {
var customerId = $(this).find("td").eq(2).html(); }
(9) Set confirm on link button in Grid -
$('#<%= Grid1.ClientID %> tbody tr').not(':first').each(function () {
$(this).find("a[id$=LinButton1]").click(function () {
return confirm('Are you sure you want to delete?');
});
});
(10) Create common function in jQuery - this function returns checked items count in grid
$.fn.gridCount = function () {
var vCount = 0;
$('#<%=GridView1.ClientID %> tbody tr').not(':first').each(function () {
var strVehicleID = $(this).find("td:first-child").find("input:checkbox");
if (strVehicleID.attr("checked") == true) {
vCount++;
}
});
return vCount;
}
(11) Some useful jQuery syntaxes
jQuery Selector
(12) Fetch Url attribute values
Get current page URL and title with jQuery
No comments:
Post a Comment