Friday, 21 September 2012

Method to add checkboxes dynamically

//Method to add checkboxes dynamically


function appendchk(checkbox,id,id){
   var cb = document.createElement( "input" );
   cb.type = "checkbox";
   cb.name= "chk_groups[]";
   cb.id = id;
   cb.value = id;
   cb.checked = false;
   var text = document.createTextNode( id );
   document.getElementById( 'prodCategories' ).appendChild(cb);
   document.getElementById( 'prodCategories' ).appendChild(text);
 document.getElementById( 'prodCategories' ).appendChild(document.createElement( "br" ));
 
}

//Call to this function

appendchk(prodEval ,prodEval.name , prodEval.name);

No comments:

Post a Comment

Thank You for your valuable comment

Difference between class level and object locking and static object lock

1) Class level locking will lock entire class, so no other thread can access any of other synchronized blocks. 2) Object locking will lo...