Knowledge Base - Can I save the user inputs on my server?

The calculators don't have any backend database, but provide means for you to retreive the input data, which you can then handle anyway you wish. We have an interface that uses a JSON object to gather input values and you can create a function to POST them to your server. This type of programming would require someone with experience in JavaScript, HTML and HTTP Server Side processing.

It is a JavaScript function that creates a JSON object that you can then POST to your server. You need to create the programming to hook this up, but the function call is simple. If you use JQuery you can easily create a small AJAX function to send this data to your server. To get the JSON object you would use the following JavaScript function on the calculator page and it would return the input values from the calculator on the page (note that the server-side process and the AJAX function are not shown below):

    Var oCalculatorJSONObject = KJE.getJSONFromInputs();

To take a JSON object that you have retrieved and populate the values back into the calculator you would use code like this:

    var oStorageItems=null; 
    try {oStorageItems = JSON.parse(oCalculatorJSONObject);} catch (errors) {oStorageItems =null;} 
    if (oStorageItems==null) oStorageItems={}; 

 

    // Populate the calculator from the retrieved object: 
    KJE.bStoragePopulate(oStorageItems);