jQuery/AJAX file upload in CakePHP 2.x

In view: /Articles/admin_add.ctp <style>#image_preview{    display:none;    }</style><!-- to display form --><?php echo $this->Form->create('ArticleImage', array("id"=>"uploadimage",'type'=>'file')); ?><div id="image_preview"><img id="previewing" src="noimage.png" /></div><div id="selectImage"><label>Select Your Image</label><br/><?php echo $this->Form->input('image', array('id'=>'file','type'=>'file')); ?>     </div><?php echo $this->Form->submit('upload', array('type'=>'submit',"value"=>"Upload", "class"=>"submit" )); ?>     <div id="message"></div>   <?php echo…

Hide or Show div

Example below shows or hides  div when a link is clicked.<html><head><script language="JavaScript">function ShowHide(divId){if(document.getElementById(divId).style.display == 'none'){document.getElementById(divId).style.display='block';}else{document.getElementById(divId).style.display = 'none';}}</script></head><body><a onclick ="javascript : ShowHide('HiddenDiv')" href="javascript:;" >Show or Hide</a><div id="HiddenDiv" style="DISPLAY: none" >Stuffs to be hidden or shown goes…

Scroll Up