PDA

View Full Version : Problem with iframes, jsp, forms, FireFox



bmachine
16 Feb 2006, 12:29 PM
OK well, heres our problem. We (my coworker and I) are trying to get our legacy code to be Firefox compatible. So in this code there is a js file we are including in the main page and on the login submit we call the following method
var s= '<iframe src="/getEnvVariables.jsp" style="display:none"></iframe>';
document.body.insertAdjacentHTML("beforeEnd",s);
I got the insertAdjacentHTML method working and I also tried to make things work with the iframe directly on the main page.
Now the getEnvVariables page does load in firefox(both ways), but the form on that page won't submit in firefox unless we start the browser on getEnvVariables.jsp This is not an option though because the username and password entered are on the main page and are submitted from a form there, which getEnvironmentVariables collects in its form and then tries to submit. Here is the form code there:
<form id="varForm" action="/setEnvVariables.jsp" method="post">
<input type="hidden" name="javaEnabled" value=""/>
......etc
</form>

and down below
document.forms['varForm'].elements['javaEnabled'].value = javaEnabled;
..etc...

document.forms['varForm'].submit();
I've checked with alerts and the data is correctly being assigned in the form elements and it is getting past the submit statement without throwing any scripting error to Firefox's console. I'm wondering if anyone has seen anything like this or has suggestions.

Rambo Tribble
18 Feb 2006, 08:08 AM
The insertAdjacent~ methods are IE-only. What you need is to use appendChild and related W3C-standard node manipulation methods.