Hi!!
I am implementing a program using java servlets but I need a javascript function to do the following:
I have a combo box with numbers on it, and I want that every time that a user selects a value from the combo box, it appears as many text boxes as the value selected.
What I have done is that on the event onChange of the combo box, I call to a javascript function that receives 3 parameters, one of wich is the value selected in the combo.
In that function I want to recall a servlet passing it the values that the function receives.
Here it is the example of the code I have done:
<HEAD>
<SCRIPT LANGUAGE=”JavaScript”>
function displayTexts(num, text, combo_value) {
window.open(“./Servlet?option=2&line=num&question=text&nanswers=combo_value”)
}
</SCRIPT>
</HEAD>
The problem is that using that way, the variables passed to the function will be passed into the servlet as literals and not as their value because they are enclosed into the address query.
How can I pass the variable’s values into the address query?
?