Click to See Complete Forum and Search --> : Help ???? Duplacate Text area.


aiden857181
04-23-2007, 06:01 PM
Please Help. ok what I have is a page on my web site with one large text area that customers can fill in. but i need that when they click a button and the text area not the text will duplacate on the page so they can fill in new info.
Please Please HELP as i need this up and running by tomrrow.


Regards
Aiden.

Fang
04-24-2007, 09:21 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>DOM</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<script type="text/javascript">
function newTextArea() {
var aTA=document.getElementsByTagName('textarea');
var textarea=document.createElement('textarea');
textarea.setAttribute('rows', 10);
textarea.setAttribute('cols', 10);
aTA[aTA.length-1].parentNode.appendChild(textarea);
}

</script>

</head>
<body>
<form action="#" name="form1">
<fieldset><legend>form</legend>
<textarea rows="10" cols="10"></textarea>
<button type="button" onclick="newTextArea();">newTextArea</button>
</fieldset>
</form>
</body>
</html>