Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 14th, 2012  |  syntax: None  |  size: 0.72 KB  |  views: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <div id="quantityHoleForPercentage">
  2. <form:input path="quantity11Profit"  id="quantity11Profit" cssClass="smaller" />                              
  3. </div>
  4. <div id="quantityHoleForPercentage">
  5. <form:input path="quantity11Price"  id="quantity11Price" cssClass="smaller" />
  6. </div>
  7.        
  8. $("#quantityHoleForPercentage input").change(function(){                    
  9.     var needless=$(this).attr('id');
  10.     var willWriteToPriceInput= $(this).val();
  11.     var priceInput=$(this).next();
  12.     priceInput.val(willWriteToPriceInput);
  13.     });
  14.        
  15. $("#quantityHoleForPercentage input[id$=Profit]").change(function(){
  16.   var willWriteToPriceInput= $(this).val();
  17.   var priceInput = $(this).parent().next()
  18.   priceInput.val(willWriteToPriceInput);
  19. });