M
Mahernoz
Task to be Accomplished: I want to copy the contents of dvAArea (after
i change a value in the dropdown or a textbox) into the new dvBArea
Problem: In Internet explorer this code works fine but Firefox gives
the unchanged content of dvAArea (and not the current content). I want
the current content of dvAArea in Firefox after i change the values in
the dropdown or text fields.
//My Page is as follows
//I am having 2 div
<div id="dvBArea"></div>
<div id="dvAArea">
<table>
<tr>
<td>
<input id="txtA0101" name="txtA0101" type="text"></td>
<td>
<input id="txtA0102" name="txtA0102" type="text"></td>
<td>
<select id="sel0106" name="sel0106">
<option value="300">300</option>
<option value="600">600</option>
<option selected="selected" value="1200">1200</
option>
<option value="2400">2400</option>
</select>
</td>
</tr>
</table>
</div>
//and a JavaScript function CopyHTML which is raised on onclick event
of a button
<input id="btnClickMe" type="button" value="Copy"
onclick="CopyHTML()"/>
//the CopyHTML function is as follows
<script language="javascript" type="text/javascript">
function CopyHTML()
{
document.getElementById('dvBArea').innerHTML =
document.getElementById('dvAArea').innerHTML;
}
</script>
Regards,
Mahernoz
i change a value in the dropdown or a textbox) into the new dvBArea
Problem: In Internet explorer this code works fine but Firefox gives
the unchanged content of dvAArea (and not the current content). I want
the current content of dvAArea in Firefox after i change the values in
the dropdown or text fields.
//My Page is as follows
//I am having 2 div
<div id="dvBArea"></div>
<div id="dvAArea">
<table>
<tr>
<td>
<input id="txtA0101" name="txtA0101" type="text"></td>
<td>
<input id="txtA0102" name="txtA0102" type="text"></td>
<td>
<select id="sel0106" name="sel0106">
<option value="300">300</option>
<option value="600">600</option>
<option selected="selected" value="1200">1200</
option>
<option value="2400">2400</option>
</select>
</td>
</tr>
</table>
</div>
//and a JavaScript function CopyHTML which is raised on onclick event
of a button
<input id="btnClickMe" type="button" value="Copy"
onclick="CopyHTML()"/>
//the CopyHTML function is as follows
<script language="javascript" type="text/javascript">
function CopyHTML()
{
document.getElementById('dvBArea').innerHTML =
document.getElementById('dvAArea').innerHTML;
}
</script>
Regards,
Mahernoz