Closed Bug 284416 Opened 19 years ago Closed 19 years ago

After JavaScript manipulation, browser is sending data from wrong form

Categories

(Firefox :: General, defect)

x86
Windows 2000
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: horn.petr, Assigned: bugzilla)

References

()

Details

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1.7.3) Gecko/20041001 Firefox/0.10.1

web page http://www.kraj-jihocesky.cz/work/mozbug.php has 2 forms, after
manipulating fom2 using Javascript and post the data using Javascript, the
browser sends wrong data - mixture of data from both forms, inputs 1,2,3 from
form 1 and input6 from form2. Normaly all data should be posted from form2
(input 3,6,id_file), because submit button is situated there. I have tested this
on Mozilla 1.7.5 and MSIE. Mozilla has the same bug, MSIE is working fine.

Reproducible: Always

Steps to Reproduce:
1.go to http://www.kraj-jihocesky.cz/work/mozbug.php
2. click on one button change value
3.enter value
4. click post form 2
5. at the bottom of page you see 
The data were posted from form No 2
Array
(
    [input1] => 322
    [input2] => 2
    [input3] => 1
    [input6] => 89
    [form2] => Post form 2
)


Actual Results:  
at the bottom of page you see 
The data were posted from form No 2
Array
(
    [input1] => 322
    [input2] => 2
    [input3] => 1
    [input6] => 89
    [form2] => Post form 2
)



Expected Results:  
at the bottom of page you see 
The data were posted from form No 2 
Array
(
    [input4] => 322
    [id_file] => 2015
    [input6] => 89
    [form2] => Post form 2
)



I try to solve this problem by changing the inputs using Javascript W3C DOM
interface, see commented section. But this change does not help at all to solve
the problem.
Summary: after Javascript manipulation ,browser is sending data from wrong form → After JavaScript manipulation, browser is sending data from wrong form
The tags in your example are nested improperly. You have something like:

<form id="form1">
<table>
...
</form>
<form id="form2">
...
</table>
</form>

Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.