chwong67
asked on
Fail to get variable value after submit at php dynamic js injection form
I create a file input area after clicked 'add button’, first element value is ‘AAA’:
<input type="text" readonly="true" name="ndiv_partd1[]" id="ndiv_partd1[]" size="30" value="AAA" maxlength="30" style="text-transform: uppercase; border: 0pt none;">
And second element with value ‘BBB’
<input type="text" readonly="true" name="ndiv_partd1[]" id="ndiv_partd1[]" size="30" value="BBB" maxlength="30" style="text-transform: uppercase; border: 0pt none;">
When I click submit button, the php can’t read and get the variable value ndiv_partd1[] at all at Firefox/Google Chrome browser. However it work fine at Internet Explorer 8.0.
When I echo the following statement:
foreach ($ndiv_partd1 as $nndiv_lp => $ndiv_alt_val) {
echo "<BR>[".$nndiv_lp."] [".$ndiv_alt_val."]
}
Output:
[0] [AAA] >>>>>
[1] [BBB] >>>>>
It’s no problem for me to get the value for each variables at IE8.0, however having difficulty at those Firefox/Google Chrome browser.
<input type="text" readonly="true" name="ndiv_partd1[]" id="ndiv_partd1[]" size="30" value="AAA" maxlength="30" style="text-transform: uppercase; border: 0pt none;">
And second element with value ‘BBB’
<input type="text" readonly="true" name="ndiv_partd1[]" id="ndiv_partd1[]" size="30" value="BBB" maxlength="30" style="text-transform: uppercase; border: 0pt none;">
When I click submit button, the php can’t read and get the variable value ndiv_partd1[] at all at Firefox/Google Chrome browser. However it work fine at Internet Explorer 8.0.
When I echo the following statement:
foreach ($ndiv_partd1 as $nndiv_lp => $ndiv_alt_val) {
echo "<BR>[".$nndiv_lp."] [".$ndiv_alt_val."]
}
Output:
[0] [AAA] >>>>>
[1] [BBB] >>>>>
It’s no problem for me to get the value for each variables at IE8.0, however having difficulty at those Firefox/Google Chrome browser.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Please note that I would consider Firefox/Chrome to be correct and IE wrong. If you remove the underscore and it still doesn't work, then I would concede that that isn't the problem. You could try putting this code at the top of your PHP page to see what it is receiving from each browser.
print_r($_REQUEST);
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
A public version of that little script is available here:
http://www.laprbass.com/RAY_temp_foo.php
http://www.laprbass.com/RAY_temp_foo.php
ASKER