Math Calculations in API

By: Walter Jones | Asked: 08/19/2022
ForumsCategory: General questionsMath Calculations in API
Walter JonesWalter Jones asked 2 years ago
Is possible to send a math calculation via the value in the API to another field?  I am trying to send a random number to a field in form, but the the math expression I am using isn’t calculating, it’s only sending the expression. 
Victor Font replied 2 years ago

Are you using jQuery or shortcodes for the calculation?

jQuery/Javascript will caclulate the answer in real time. YOu would store the value in a hidden field and send the hidden field value through the API.

Shortcodes calculate the values on the server. You can still use the expression in a hidden field to calculate a defaul value and send the default value through the API.

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