Targeting an iFrame with <form> submit provokes 404 error in new tab.




8 years ago
8 years ago


(Reporter: dnp, Unassigned)


Firefox Tracking Flags

(Not tracked)




8 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20110319 Firefox/3.6.16
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv: Gecko/20110319 Firefox/3.6.16

Last week this code worked fine. Nothing has changed in the script, but today it fails:

<form id="filterListForm" target="dataFrame" method="post" action="listData.php" >
<select id="year" name="year" onchange="getObjectByID('filterListForm').submit();">

<iframe id="dataFrame" src="listData.php"></iframe>

It's especially weird that the 404 error opens in a new tab when I've specified a target of "dataFrame." And it's weird that it's a 404 error, because the script is already open in dataFrame and the URL is identical in both references.

Reproducible: Sometimes

Steps to Reproduce:
Create a web page with an iframe.

Create a form on the same page whose submit target is a script already open in that iframe.

Attach a .submit() action as the onchange event for a select element within the form.

Actual Results:  
404 error appears in a separate tab.

Expected Results:  
Targeted script should respond to the post event and place its results in the iframe.

The same code works fine in other browsers. Doctype should allow iframes, including the deprecated target property:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "">

Comment 1

8 years ago
Looking it over, I figured it out.

This is NOT a browser problem. The iframe should have a name property and not simply an id for this to work.
Last Resolved: 8 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.