Advertisement
DrupalCustom

preJs

Feb 10th, 2012
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     $(document).ready(function () {
  2.       $("#edit-status-list").change(function() {
  3.       var selectedStatus = $(this).find(":selected").text();
  4.       var charExists = ((window.location.href).indexOf('?') >= 0) ? true : false;
  5.      
  6.      if(charExists){
  7.      var split = (window.location.href).split('?');
  8.      var loc = split[0];
  9.      
  10.      loc = loc+"?status="+selectedStatus;  
  11.      self.location.href= loc;
  12.      
  13.      }
  14.      
  15.      else{
  16.       var locf = window.location.href+"?status="+selectedStatus;  
  17.       self.location.href= locf;
  18.      
  19.       }
  20.      
  21.       });
  22.      
  23.       $("#create-freeway-project").submit(function() {
  24.         $(":submit", this).attr("disabled", "disabled");
  25.            
  26.       });
  27.      
  28.      $(".common_link_class").click(function() {
  29.             //alert("Hello");
  30.          
  31.           var count = ($(this).data("clicks") || 0) + 1;
  32.           $(this).data("clicks", count);
  33.          
  34.          
  35.           if ($(this).data("clicks") >= 1) {
  36.          
  37.           }
  38.          
  39.          
  40.           if ($(this).data("clicks") >= 2) {
  41.            
  42.             return false;
  43.           }
  44.         });
  45.        
  46.        
  47.           $("#edit-analysis-code-one").change(function () {
  48.             // Get the configs and split them.
  49.             var cfgs = _get_configs("edit-custRef");
  50.             var split_cfgs = cfgs.split('/');
  51.            
  52.             // Create some new configs and put it back into the configs textfield.
  53.             //var new_cfgs = $(this).val() +"/"+ cfgs[1];
  54.             var new_cfgs = $("#edit-analysis-code-one option:selected").text() +"/"+ cfgs[1];
  55.            
  56.             $("#edit-custRef").val(new_cfgs);
  57.           });
  58.          
  59.           $("#edit-analysis-code-two").change(function () {
  60.             // Get the configs and split them.
  61.             var cfgs = _get_configs("edit-custRef");
  62.             var split_cfgs = cfgs.split('/');
  63.            
  64.             // Create some new configs and put it back into the configs textfield.
  65.             //var new_cfgs = cfgs[0] +"/"+ $(this).val();
  66.             var new_cfgs = cfgs[0] +"/"+ $("#edit-analysis-code-two option:selected").text()
  67.             $("#edit-custRef").val(new_cfgs);
  68.          });
  69.        
  70.    
  71.     });
  72.  
  73. function _get_configs(id) {
  74.  
  75.   return $("#"+ id).val();
  76.  
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement