Run query from javascript
Posted: Tue Apr 06, 2021 11:48 pm
As a newbie with nuBuilder Forte, I created a form with a subform. The form contains a customer field, the subform contains rows with a zip-code, weight and price.
When the zipcode or the weight is changed, I need to fetch the matching price from the database (some matrix which defines the prices).
In the (javascript) onchange-event of the zip-code and weight fields, i have managed to fetch the values of the customerId, weight and zipCode.
Also I defined the query which has to be run and returns the price.
But I have no clue how to proceed from JavaScript to PHP and actually run this query and return the value so I can update the value field.
Any tips/suggestions on this? Or is there a better approach?
When the zipcode or the weight is changed, I need to fetch the matching price from the database (some matrix which defines the prices).
In the (javascript) onchange-event of the zip-code and weight fields, i have managed to fetch the values of the customerId, weight and zipCode.
Also I defined the query which has to be run and returns the price.
But I have no clue how to proceed from JavaScript to PHP and actually run this query and return the value so I can update the value field.
Any tips/suggestions on this? Or is there a better approach?