verse.thekeg
Dec 22nd 2008, 9:00 pm
I have a form which I want to have the data the user submits to be copied. It is a local web-app meaning it has to work offline. Here's my attempt to get this to work.
<script type="text/javascript">
function copyValue(el)
{
document.getElementById('copy_' + el.id).innerHTML = el.value;
}
</script>
First Name: <input type="text" name="First Name" style="width:160px" id="First Name" onchange="copyValue(this);">
Last Name: <input type="text" name="Last Name" style="width:160px" id="Last Name" onchange="copyValue(this);">
<input type="button" value="Submit"/>
<span id="copy_First Name" style="font-weight: bold;">
<span id="copy_Last Name" style="font-weight: bold;"></span>
<script type="text/javascript">
function copyValue(el)
{
document.getElementById('copy_' + el.id).innerHTML = el.value;
}
</script>
First Name: <input type="text" name="First Name" style="width:160px" id="First Name" onchange="copyValue(this);">
Last Name: <input type="text" name="Last Name" style="width:160px" id="Last Name" onchange="copyValue(this);">
<input type="button" value="Submit"/>
<span id="copy_First Name" style="font-weight: bold;">
<span id="copy_Last Name" style="font-weight: bold;"></span>