catz_120
asked on
request.getParameter in a loop
I'm creating a matrix table with a lot of textboxes. The textboxes are named in a loop as follow:
<td><input type="text" name="<%=k%>-<%=i%>" size="6"></td>
When i passed the textbox values to the next page, I couldn't get the value of the textboxes (value = null).
Following is my script:
String[] result = new String[total];
String[] answer = new String[total];
int m=0;
int g=0;
for (int x=1; x <= counter; x++) {
for (int y=1; y <= counter; y++) {
result[m] = x + "-" + y;
answer[m] = request.getParameter("+res ult[m]+");
m++;
}
}
Anything wrong with the loop?
<td><input type="text" name="<%=k%>-<%=i%>" size="6"></td>
When i passed the textbox values to the next page, I couldn't get the value of the textboxes (value = null).
Following is my script:
String[] result = new String[total];
String[] answer = new String[total];
int m=0;
int g=0;
for (int x=1; x <= counter; x++) {
for (int y=1; y <= counter; y++) {
result[m] = x + "-" + y;
answer[m] = request.getParameter("+res
m++;
}
}
Anything wrong with the loop?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>request.getParameter(""+ result[m]+ "")
should be request.getParameter(""+re sult[m])
The other String concatenation is unnecessary
should be request.getParameter(""+re
The other String concatenation is unnecessary
result[m] = x + "-" + y;
answer[m] = request.getParameter("+res ult[m]+");
I am seeing it as a String so simply
answer[m] = request.getParameter(resul t[m]) will work
answer[m] = request.getParameter("+res
I am seeing it as a String so simply
answer[m] = request.getParameter(resul
This error message is displayed by the Microsoft Windows Installer engine and is a general error code that indicates a problem occurred during the installation. The following is a non-exhaustive list of known causes for this error:
* Short file name creation is disabled on the target machine.
* An InstallScript custom action is prototyped incorrectly.
* A file is locked and cannot be overwritten.
* The Microsoft Windows Installer Service is not installed correctly.
* The Windows Temp folders are full.
* The setup was corrupted after installation and, therefore, fails with this error during uninstallation.
* An older version of InstallShield Developer is being used.
* A general error occurred during the installation.
* Print and File sharing is not installed or enabled when installing MSDE 2000.
* Short file name creation is disabled on the target machine.
* An InstallScript custom action is prototyped incorrectly.
* A file is locked and cannot be overwritten.
* The Microsoft Windows Installer Service is not installed correctly.
* The Windows Temp folders are full.
* The setup was corrupted after installation and, therefore, fails with this error during uninstallation.
* An older version of InstallShield Developer is being used.
* A general error occurred during the installation.
* Print and File sharing is not installed or enabled when installing MSDE 2000.
oops wrong post
sorry
sorry
ASKER
thx for all the responses,
request.getParameter(resul t[m]); does work
request.getParameter(resul
request.getParameter(""+re