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=”” />

Redirect users to custom page with notification

In form registrations, and form operations which consists insert, update and delete actions; we often need to redirect user after a successful/unsuccessful operation(s). To inform user about the fail or success of operations, you can set flash messages, which you can set manual messages for any operations you want. Flash messages automatically destroy themselves after …

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” …

Unable to create directory /home/jamshidh/public_html/wp-content. Is its parent directory writable by the server?

I recently had a problem regarding this issue in my blog (WordPress 3.3). The problem occured when I wanted to upload an image to one of posts. When trying to upload the image, the following error occured: Unable to create directory /home/jamshidh/public_html/wp-content. Is its parent directory writable by the server? After some searchs regarding this …

Image upload with Codeigniter

1) Create upload.php file inside controller, copy and past the following code into. Also create an ‘uploads’ folder inside the codeigniter root folder. <?php //Author: Jamshid HASHIMI class Upload extends CI_Controller { function __construct() { parent::__construct(); $this->load->helper(‘form’); $this->load->helper(‘url’); } function index() { $this->load->view(‘upload_view’); } //Upload Image function function uploadImage() { $config[‘upload_path’] = “uploads/”; $config[‘allowed_types’] = …