Here is a function I created to open a new window with a specific URL and pass certain parameters.
function viewWeightAge() {
var userNIC = document.getElementById("NICNo");
var childName = document.getElementById("childName");
window.location.href = "https://localhost:8080/KiddieCare/AdminPanel/WeightAgeGraph.jsp?childName="+childName+"&userNIC="+userNIC;
}
Could somebody help me identify the error in this code?
Updated Question:
function showWeightAge(){
var userNIC = document.getElementById("NICNo");
var childName = document.getElementById("childName");
var parameters= userNIC,childName;
window.open ('https://localhost:8080/KiddieCare/AdminPanel/WeightAgeGraph.jsp','Window Name',parameters);
}
I have attempted to open a new window with the function above. It should look like thishttps://i.sstatic.net/bbLEu.png
By using window.open(), I am able to open a new window, but I am struggling to pass parameters to the new JSP file.