Similar to jQuery how to load some json records into a form fields?, I'm having a rather complex form where fields interact with each other, requiring recalculations (some complex mathematics) as well as disabling fields upon certain conditions. Class at server which may output JSON or similar.
The calc-request is fired by jquery on any field-onchange, and should pick up the class-response and act accordingly. About acting upon the ajax-response:
Can the response be formatted so the fields are updated/faded without iterating the JSON-result?
Please provide an example of a state-of-the-art json-response for such functionality.
I'm trying not to reinvent the wheel but keen to go as vanilla as possible, plugins tend to break.
EDIT:
In essence:
$.ajax({
url: "theCalcClass.php",
context: document.body
}).done(function() {
//use the json data to update fields w/o foreach...
});