Copying text boxes data?
Moderator: General Moderators
Copying text boxes data?
I am wanting to display data that is in some text boxes into other text boxes that is on one page after a check box has been selected. Can someone please tell me how I can do this with some code. Thanks in advance.
-
alex.barylski
- DevNet Evangelist
- Posts: 6267
- Joined: Tue Dec 21, 2004 5:00 pm
- Location: Winnipeg
Javascript.
Untested but you get the idea 
Cheers
Code: Select all
<form name="test">
<input type="text" id="field_1" name="field_1" />
<input type="text" id="field_2" name="field_2" />
<input type="checkbox" onclick="copyContent" />
</form>
Code: Select all
function copyContent()
{
//var tmp = document.forms.test.field_1.value - If below doesn't work?
var tmp = document.getElementById('field_1').value;
document.getElementById('field_2').value = tmp;
}
Cheers