Sorry, I don't follow your question... Do you mean that if the user fills in the value in one field it clears the other one?
Sorry. My lack of scripting skills has translated in not explaining it well!
Basically, I need two fields to have calculations. Users pick one or the other and which ever they enter data into would calculate in the one they don't pick. They'll need to fill in at least one of them.
The user has to drive to decision, but they both need to have calculations that are exclusive from each other, yet dependent on the other.
Does that make sense??
You pick one of two fields, I give you a calculation on the one you don't pick. Essentially, both fields need to be dynamic.
So both fields are editable (and empty), and if the user enters something into field A then field B gets a calculated value, and vice versa?
Yes, sir!! Is that possible? And maybe we should say, "...or vice versa?"
I think so, but it's quite tricky to implement... Also, you'll need to provide the full details of how the calculations should work.
Here's another recap:
User inputs PAY1 (current salary)
If user inputs PERCENTAGE, a hidden field CALCULATE1 calculates: percentage number, by PAY1, by .01 and populates PAY2 (new salary) which has a sum calculation PAY1,
If user inputs PAY2 (new salary), a hidden field CALCULATE2 calculates the percentage number (I haven't figured that calculation out yet) and populates PERCENTAGE (might need a calculation if I can't work it all out in the CALCULATE2 field)
And what if the user then goes back and edits PAY1? Which of the fields should be calculated then?
Not sure. This is sounding more and more unattainable. The only reason for PAY1 change would be an error entry. It is an static number because it is the current salary. The user knows it or put in the wrong number.
I suggest thinking of an alternative way of doing it, like having two
radio-buttons and one text field, where the user can select either manual
entry or automatic calculation, or something like that.