Thormar

hdselect

May 25th, 2012
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 1.46 KB | None | 0 0
  1. $("#hdselect").click(function(){
  2.             $(".modal").html("");
  3.            
  4.             $.post('mediaservice.php',{hd:'ok',images:$("#hdimages").val()},function(data){
  5.                 $(".modal").append(data);
  6.             });
  7.             $(".modal").dialog({
  8.                 'modal':true,
  9.                 'title':"Click the image to select",
  10.                 'width':960,
  11.                 'height':600,
  12.                 'resizable':false,
  13.                 'show': {effect: 'drop', direction: "up"},
  14.                 'buttons': {"Ok": function() {  
  15.                         var hd=Array();
  16.                         var hdval=$("#hdimages").val();
  17.                         $("#hdimages").attr('value',' ');
  18.                         $("input[name='hd[]']:checked").each(function(){
  19.                             hd.push($(this).val());
  20.                         });
  21.                         if(hdval!=''){
  22.                             hdval=hdval+","+hd;
  23.                         }else{
  24.                             hdval=hd;
  25.                         }                        
  26.                         $("#hdimages").val(hdval);
  27.                         var images=$("#hdimages").val();
  28.                         $.post('mediaservice.php',{getHd:images},function(data){
  29.                             $("#imgthumbBase").append(data);
  30.                         });
  31.                         $(this).dialog("close");
  32.                     }
  33.                 }
  34.             });
  35.         });
Advertisement
Add Comment
Please, Sign In to add comment