SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Dynamic Form
-
Aug 21, 2007, 08:33 #1
- Join Date
- Apr 2002
- Posts
- 25
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Dynamic Form
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">
-
Aug 21, 2007, 09:09 #2
- Join Date
- Jul 2007
- Posts
- 345
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You are calling the event handler in your code. Should it be
Code:check.onclick = SameAddress;
Then in SameAddress, use this.form to reference the form.
Bookmarks