msuryadarma
Programmer
Hi all, I have an asp page that accepts users input in textboxes, process them, and writes the output on the same page. This page is written in javascript, it works fine in IE, but doesn't work in Netscape.
Here's how it works:
1.html: User enters a number x. Press Submit.
2.asp: Opens up with x number of textboxes, ready for input. A submit button. There is a second set of x textboxes to place the output after user presses Submit. Let's just say if the input is 3, after pressing submit the output in the 2nd set of textbox is 6.
So all the input, calculations, and output is done on one page, 2.asp. Is this even possible in netscape?
This is the code of 2.asp. Let me say that transition from 1.html to 2.asp works fine. It messes up when I press Calculate on 2.asp.
The server-side script is written in VBScript, yes. The client-side used to be in VBScript as well, but I wanted to make it work for Netscape, that's why I'm converting it to JavaScript.
<%@ LANGUAGE="VBScript" %>
<html>
<head>
<title></title>
<script LANGUAGE="JavaScript">
//Function to calculate (input * 2)
function Calculate() {
var BN = document.frmBoxes.txtBN.value
for (var Ctr = 0; Ctr <= (GN - 1); Ctr++) {
var Input = document.frmBoxes.txtInput(Ctr).value
var Result = (Input * 2)
document.frmBoxes.txtResult(Ctr).value = Result
}
}
</script>
</head>
<body>
<form NAME="frmBoxes">
<table>
<%
Dim BoxNum
//Getting the input from 1.html for # of boxes to display
BoxNum = Request.Form("txtBoxNum"
//Writing how many boxes is requested.
Response.Write "<tr><td align=right><b># of Boxes:</b></td><td><input TYPE=text NAME=txtBN SIZE=5 VALUE=" & GuestNum & " READONLY TABINDEX=0></td></tr>"
//Drawing the textboxes.
For Counter = 1 to BoxNum
Response.Write "<tr><td><b><u>Box " & Counter & "Input:</u></b></td><td><input TYPE=text NAME=txtInput SIZE=10></td>" & _
"<td> =============> </td><td><b>Box " & Counter & " Result: $<td></b><input TYPE=text NAME=txtResult SIZE=10 READONLY TABINDEX=0></td></tr>"
Next
%>
</table>
</form>
<form NAME="frmCalc" OnSubmit="Calculate(); return false;">
<p><input TYPE="submit" NAME="cmdCalc" VALUE="Calculate!" SIZE="15" TABINDEX="32766"> </p>
</form>
</body>
</html>
I didn't put action= in the frmCalc frame because this is not going to any other page. But even then, I tried putting action="2.asp" and it still doesn't work.
So what happens if I press Calculate? The page refreshes and deletes all the textboxes, and just displays txtBN textbox and the Submit button.
Thank you very much for any help.
Martin
[sig][/sig]
Here's how it works:
1.html: User enters a number x. Press Submit.
2.asp: Opens up with x number of textboxes, ready for input. A submit button. There is a second set of x textboxes to place the output after user presses Submit. Let's just say if the input is 3, after pressing submit the output in the 2nd set of textbox is 6.
So all the input, calculations, and output is done on one page, 2.asp. Is this even possible in netscape?
This is the code of 2.asp. Let me say that transition from 1.html to 2.asp works fine. It messes up when I press Calculate on 2.asp.
The server-side script is written in VBScript, yes. The client-side used to be in VBScript as well, but I wanted to make it work for Netscape, that's why I'm converting it to JavaScript.
<%@ LANGUAGE="VBScript" %>
<html>
<head>
<title></title>
<script LANGUAGE="JavaScript">
//Function to calculate (input * 2)
function Calculate() {
var BN = document.frmBoxes.txtBN.value
for (var Ctr = 0; Ctr <= (GN - 1); Ctr++) {
var Input = document.frmBoxes.txtInput(Ctr).value
var Result = (Input * 2)
document.frmBoxes.txtResult(Ctr).value = Result
}
}
</script>
</head>
<body>
<form NAME="frmBoxes">
<table>
<%
Dim BoxNum
//Getting the input from 1.html for # of boxes to display
BoxNum = Request.Form("txtBoxNum"
//Writing how many boxes is requested.
Response.Write "<tr><td align=right><b># of Boxes:</b></td><td><input TYPE=text NAME=txtBN SIZE=5 VALUE=" & GuestNum & " READONLY TABINDEX=0></td></tr>"
//Drawing the textboxes.
For Counter = 1 to BoxNum
Response.Write "<tr><td><b><u>Box " & Counter & "Input:</u></b></td><td><input TYPE=text NAME=txtInput SIZE=10></td>" & _
"<td> =============> </td><td><b>Box " & Counter & " Result: $<td></b><input TYPE=text NAME=txtResult SIZE=10 READONLY TABINDEX=0></td></tr>"
Next
%>
</table>
</form>
<form NAME="frmCalc" OnSubmit="Calculate(); return false;">
<p><input TYPE="submit" NAME="cmdCalc" VALUE="Calculate!" SIZE="15" TABINDEX="32766"> </p>
</form>
</body>
</html>
I didn't put action= in the frmCalc frame because this is not going to any other page. But even then, I tried putting action="2.asp" and it still doesn't work.
So what happens if I press Calculate? The page refreshes and deletes all the textboxes, and just displays txtBN textbox and the Submit button.
Thank you very much for any help.
Martin
[sig][/sig]