Skip to main content

Posts

Showing posts from January, 2014

JSON Jquery Ajax

If use want to trigger ajax on Click   $('.taskStat').live('click',function(){        $.ajax({             type: 'POST',             url: ajax_url+"Members/change_Addtask/"+stat,             success: function(data) {                 var obj=JSON.parse(data);                 if(obj.resp=='true')                 {                     alert("Hello sudhir");                 } else                 {          ...

Validate Month Day Year

Validate drop down month , day , year  User Jquery : var year=$("#year").attr('value');     var month=$("#month").attr('value');     var day=$("#day").attr('value');     var data="year="+year+"&month="+month+"&day="+day;         $.ajax({             type:"get",             url:"<?php echo HTTP_ROOT;?>validate/validDate?"+data,             success: function(resp){                 if(resp=="false"){                                  alert("Success");                 }else{ ...

jQuery used in projects

jQuery Used in Projects 1. Get the length of any class     var numItems = $('.video_box').length;     //Here we get the length of video_box class 2. Get the value of first class     var sourcePath = $(".firstLoadThumb").first().val();     //Here we get the first firstLoadThumb class value 3. Splits the text into array     var sourcePath = "lion|dog|cat";     animal = sourcePath.split('|');     console.log(animal[0]);     //It is explode the string into array. Here animal[0] return lion. 4. Load the page by jquery     location.reload(); 5. Datepicker     Open Datepicker on image click     Html code:     <div class="input-append date" id="dp3">         <input type="text" id="datepicker" />         <span class="add...

One update method for all member

Function function admin_update($table=NULL,$id=NULL) {                  $id = convert_uudecode(base64_decode($id));          $status = $this->$table->findById($id);          $data[$table]['id'] = $id;          if($status[$table]['status']=='Inactive')          {              $this->$table->updateAll(array($table.'.status'=>'"Active"'),array($table.'.id'=>$id));          }          else          {              $this->$table->updateAll(array($table.'.status'=>'"Inactive"'),array($table.'.id'=>$id));          ...

Jquery Image Validation

1 ) jQuery validator method jQuery.validator.addMethod('img_ext',function(value,element){         if(value=="")         {             return true;         }         //alert(element.files[0].size);         var ext_index=value.lastIndexOf('.');         var ext=value.substring(ext_index+1);         var ext_lcase=ext.toLowerCase();         if(ext_lcase=='jpeg' || ext_lcase=='jpg' || ext_lcase=='png' || ext_lcase=='gif')         {             return true;         } else {             return false;         } }, "Please ...