I have created a dynamic form. I am having 1 last issue. I have a JavaScript that will populate text boxes onclick. When I try to include the event in the form it doesnt want to work.

Here is the code that adds the checkbox:

Code JavaScript:
var check=document.createElement('input');
check.type='checkbox';
check.name='copy2';
check.value='checkbox';
check.onclick='SameAddress(this.form)';

It adds the checkbox but seems to want to leave out the onclick:
Code HTML4Strict:
<input value="checkbox" name="copy2" type="checkbox">