9 Replies Latest reply on Mar 2, 2017 9:59 AM by try67

    I have multiple equations that interconnect within fields


      First off, I am NOT a scripter. I've learned from this Forum (lots of script "lifting") and reading. This is a little more complicated for me than the usual question.


      Users are submitting a form in which they will enter a current salary, a maximum they cannot exceed (required field) and then they will either enter a percentage for the increase that calculates the new salary OR they might enter their own "new" salary which cannot exceed the maximum and shouldn't exceed the 5%, but could (there are conditions outside of the form that would allow more than 5%). I have a hidden field that will automatically calculate the new salary if the user inputs the percentage. When it comes to choice, I don't have the option to require them to fill out one field or the other; some may pick percentage and some may chose to enter the new salary themselves.


      Is there a way to make both fields "available" to the user (conditional), but exclusively validated. I hope I'm explaining this correctly.

      The fields are

      PAY1 (current salary)


      PAY2 (new salary)

      POSMax (the required budgeted maximum salary for the position)

      Calculation (hidden field with simplified field notation: PAY1*Percentage*.01)


      The PAY2 field has value sum "PAY1, calculation" and also a custom validation script:  if (event.value==0) event.value =""; so that nothing shows in the field until the calculation is completed.

      The Percentage field also has the custom validation script to keep it blank.