abajan

formID_12621934763_add2fieldsAndInsertTotalx2InA3rdField

Oct 7th, 2011
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. STEP 1
  2.  
  3. In the head of the same page within which the full source of the form has been embedded, add the following script:
  4.  
  5. <script type="text/javascript">
  6. function totalx2()
  7. {
  8. a = document.form_12621934763.q1_whatI.value
  9. b = document.form_12621934763.q3_myExpanded.value
  10.  
  11. c = (a * 2) + (b * 2)
  12.  
  13. document.form_12621934763.q4_myTwo.value = c.toFixed(2);
  14. }
  15. </script>
  16.  
  17.  
  18. STEP 2
  19.  
  20. Search for the following in the form's source that's embedded in the page:
  21.  
  22. <input type="text" class="form-textbox" id="input_4" name="q4_myTwo" size="15" />
  23.  
  24. and change it to this:
  25.  
  26. <input type="text" class="form-textbox" id="input_4" name="q4_myTwo" size="15" onfocus="totalx2();" />
  27.  
  28.  
  29. STEP 3
  30.  
  31. Save the change
Advertisement
Add Comment
Please, Sign In to add comment