Dynamically Add Javascript and CSS Files in CodeIgniter Header Page

Those who are developing web projects know that, header pages are always the constant file of their template folder. The classic way of using a header page in small projects are to fill it with constant JavaScript and CSS files along with html tags and use it in inside functions where you need. The problem arise when …

How to invoke on check event of a checkbox[]

Let’s learn how to invoke a checkbox[]’s checked event. Our checkbox: <input type=”checkbox” id=”check[]” name=”check[]” value=”<?=$item->id?>” class=”checkbox” onchange=”javascript: showhidecheckbox(‘check[]’,’sendto’,’1′);” /> our onchange event call showhidecheckbox() javascript function. This function is used to detect the checkbox status and show or hide a div named “sendto”. function showhidecheckbox(checkboxname,name1) { var d1=document.getElementById(‘sendto’).style; if($(‘input[name=”check[]”]:checked’).length > 0) { d1.display =’block’; …

Get checked Ids of Jstree in form submit

Everyone, who worked with Jstree’s may face to this question: How to get the checked Ids of Jstree in form submit? here is the solution: <script type=”text/javascript> function submitMe() { var checked_ids = []; $(‘#your-tree-id’).jstree(‘get_checked’,null,true).each(function(){ checked_ids.push(this.id); }); //setting to hidden field document.getElementById(‘jsfields’).value = checked_ids.join(“,”); } </script> <input type=”hidden” name=”jsfields” id=”jsfields” value=”” />

Close Popup Window and Refresh Parent Page

I needed this simple code tonight, I tried many ways, but this one worked perfectly. It firstly closes your popup window, and refresh the parent page then. //close popup window and refresh the parent window function CloseAndRefresh() { window.close(); if (window.opener && !window.opener.closed) { window.opener.location.reload(); } } You can use it like this: <input type=”button” …