Hello all, afetr receiving such excellent help regarding my first ajax file, i have received an error in my code that i have not encountered before.
I have created a form with input fields and when the button is clicked, three functions are run, the first is an ajax call to a php file that creates and populates a table based on values from the database, the second executes the calculation function, the third takes the calculation results and inserts them into the table created from the ajax call.
After all my tests, i found the error lies in the calculation.js file, the following code works;
function multiply() {
document.getElementById("A").value = (calculation) ;
document.getElementById("B").value = (another_calculation) ;
document.getElementById("C").value = (another_calculation) ;
document.getElementById("D").value = (another_calculation) ;
alert("Calculation done");
}
//POPULATE ORDER TABLE WITH RECOMMENDED VALUES
function fillOrder() {
document.getElementById("A_order").value = document.getElementById("A").value;
document.getElementById("B_order").value = document.getElementById("B").value;
document.getElementById("C_order").value = document.getElementById("C").value;
document.getElementById("D_order").value = document.getElementById("D").value;
alert("Orders values added");
}
However, when i remove the alerts, i get an error in the javascript saying antibody_order is null.