luisoscarb
09-25-2008, 06:46 PM
Hello,
I posted a thread two days ago (before the the database rolled back) about passing parameters from ASP to JavaScript. I was able to go around that problem thanks to the user ess, but I have stumbled upon another issue.
I have code in ASP that loops over HTML code, repeating the following snippet of code:
<input type="text" name="input_A(##)" />
<input type="text" name="input_B(##)" />
<input type="button" value="Func" name="Button" onclick="javascript: TestFunction(this.form.input_A(##).value, this.form.input_B(##).value);"/>
Note: The ## implies that a number goes there. The code increases those values starting from 0, 1, 2, ... , n.
The function it calls is located here:
<script type="text/javascript">
function TestFunction(inp_A, inp_B) {
window.alert(inp_A + inp_B); //prints out inp_A and inp_B concatenated
}
</script>
It doesn't work when I pass it with the numbers attached, but otherwise, it works just fine:
<input type="text" name="input_A" /> //no array values
<input type="text" name="input_B" />
<input type="button" value="Func" name="Button" onclick="javascript: TestFunction(this.form.input_A.value, this.form.input_B.value);"/>
I know the array is able to store accurate values [another page gets them when I use request.form(input_A(##)) ]so I assumed there wouldn't have been a problem with my code. Nonetheless, it's not working. Is there any way to fix this?
Thanks!
luis
I posted a thread two days ago (before the the database rolled back) about passing parameters from ASP to JavaScript. I was able to go around that problem thanks to the user ess, but I have stumbled upon another issue.
I have code in ASP that loops over HTML code, repeating the following snippet of code:
<input type="text" name="input_A(##)" />
<input type="text" name="input_B(##)" />
<input type="button" value="Func" name="Button" onclick="javascript: TestFunction(this.form.input_A(##).value, this.form.input_B(##).value);"/>
Note: The ## implies that a number goes there. The code increases those values starting from 0, 1, 2, ... , n.
The function it calls is located here:
<script type="text/javascript">
function TestFunction(inp_A, inp_B) {
window.alert(inp_A + inp_B); //prints out inp_A and inp_B concatenated
}
</script>
It doesn't work when I pass it with the numbers attached, but otherwise, it works just fine:
<input type="text" name="input_A" /> //no array values
<input type="text" name="input_B" />
<input type="button" value="Func" name="Button" onclick="javascript: TestFunction(this.form.input_A.value, this.form.input_B.value);"/>
I know the array is able to store accurate values [another page gets them when I use request.form(input_A(##)) ]so I assumed there wouldn't have been a problem with my code. Nonetheless, it's not working. Is there any way to fix this?
Thanks!
luis