Guest User

Untitled

a guest
Jan 21st, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <script type="text/javascript" charset="utf-8">
  2.  
  3. $(document).ready(function(myVar) {
  4.            
  5.     myVar = <?php echo ($this->Input->post('EUR')); ?>;
  6.    
  7.     if(typeof myVar != 'undefined') { // value from previous page exists
  8.    
  9.         var radioValues = [100, 50, 30, 15]; // all possible values
  10.        
  11.         if(jQuery.inArray(myVar,radioValues) > -1) { // is in array
  12.             path= '#f5 input[value='+myVar+']';        
  13.         } else { // is not in array
  14.             path= '#f5 input[value=anderer]';  
  15.             $('input[name=AndererBetrag]').val(myVar); // set text field val
  16.         }
  17.        
  18.         $(path).attr('checked', true); //set checkbox
  19.    
  20.     }
  21.  
  22. });
  23.  
  24. </script>
Add Comment
Please, Sign In to add comment