Forum Moderators: open

Message Too Old, No Replies

innerHTML and submit data in firefox

innerHTML and submit

         

mexican

2:21 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



I don't seams to be able to update content of a page with javascript (in firefox) and then send that content withina submit form.

The Data that I want to update from an iframe via javascript and write that data out to a table inside the page. That table is incased in a form tag.

I know that I can get the data from the iframe because is I alert the data returned from a function in the iframe it alerts the right data, it just seams to be unable to send that data?

//Example:, the usercd variable is essentially a
// <input type=hidden tag

var usercd = parent.user.getUserCodes(); //get the data from a function in the iframe
document.getElementById("hiddenvars").innerHTML=usercd;
document.user_info.submit();
...
<form method="get" action="savedata.jsp" name="user_info" id="formname">
<tr>
<td id="hiddenvars" colspan="3">
<!-- insert updated code in here-->
</td>
</tr>

kaled

2:27 pm on Nov 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using innerHTML to create <input> items, etc. or simply to assign values to existing items?

Kaled.

mexican

2:40 pm on Nov 8, 2005 (gmt 0)

10+ Year Member



I'm an idiot!

I found the solution.
I put the <form> tag out side of the <tr> element instead of outside the <table> element, I.E. understood this but FF's strict parsing of the page meant that it didn't send the data!

To answer your question in any case: no, I just store all input tag data and every thing inside the single string that the getUserCodes function returns.