I need two field's quantities/percentages to cause each other's values to change accordingly.

By: Harry Carter | Asked: 05/07/2023
ForumsCategory: Code HelpI need two field's quantities/percentages to cause each other's values to change accordingly.
Harry Carter asked 12 months ago

I have a lookup with a set "Prod Rate Per Day" ID 403 (number) field that initially equals "Prod Rate % ID 506, a percentage of 100%  When I change the Prod Rate Per Day ID 403  number, I need the Prod Rate % ID 506 percentage to change from 100%  to whatever percentage the changed ID 403 amounted to. But I also need this to work both ways. If I change the 403, then the 506 % changes. If I change the 506 %, then the 403 number changes. And as I said, the number that is originally populated equals 100%.

Attachments
Rob LeVineRob LeVine replied 12 months ago

Using jQuery to set up change event listeners on the fields and then doing the math and updating the affected fields is the only way I can think of. It's pretty simple jQuery code, though it depends on your comfort level with coding.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right