[thelist] Inserting Form Fields with JS in Netscape 6+

Hassan Schroeder hassan at webtuitive.com
Thu Dec 5 13:32:19 CST 2002


Scott Brady wrote:

> We couldn't get the code you sent to work in Mozilla 1.1, so here's
 > a sample of the code we're trying that doesn't work in Mozilla 1.1
 > (or 1.0).  Happen to spot anything wrong with it? (By doesn't work,
 > I mean the dynamic form fields don't get submitted with the form)

> <script type="text/javascript">
> 	function addFormElements2(){
> 		place1 = document.getElementById('placeHolder1');
> 		newTextObj = document.createElement('input');
> 		newTextObj.setAttribute("type","input");

"type" here should be "text", not "input"...

> 		newTextObj.setAttribute("name","dynamic1");
> 		newTextObj.setAttribute("value","test");
> 		place1.appendChild(newTextObj);

> <form action="dynamicForm.cfm" method="post">

I don't know why it would make a difference but I'm using GET;
have you tried that as a test? (just to check the query string
contents).

Other than that... if the type change doesn't fix it, let me know
and I'll look at my own working page some more for differences.

--
Hassan Schroeder ----------------------------- hassan at webtuitive.com
Webtuitive Design ===  (+1) 408-938-0567   === http://webtuitive.com

                           dream.  code.






More information about the thelist mailing list