adsense

Tuesday, July 31, 2018

Get Total Checkboxes using jQuery

Suppose there are several check boxes which are either checked or unchecked. jQury can be used to easily get the number of all check boxes, checked and unchecked boxes as shown below.

var totalCheckboxes = $('input:checkbox').length;
var totalChecked = $('input:checkbox:checked').length;
var totalUnChecked = totalCheckboxes - totalChecked ;

 

Cheers,
Samitha

Thursday, July 26, 2018

jquery Find all elements containing part of an ID

We can use jQuery to find all  elements that starts with of characters as shown below

  $("[id*=_visible_]").each(function(element){
     element.val(''); // do something with the found element.
});

Cheers,
Samitha

Thursday, July 19, 2018

Create an insert script using SELECT

There are many third party tools that provides this feature, but you can use a simple
select statement  easily create an insert script as shown belowe.

Suppose you have employee table  and want to use it to generate data for another table.


select 'insert into Table1 values(' + Id + ', ' + name + ')' from employee


Cheers,
Samitha