Click to See Complete Forum and Search --> : dynamically created INPUT and TEXTAREA elements do not submit their values, Why?


dhanya_kr
05-13-2006, 07:28 AM
hi all,

dynamically created INPUT and TEXTAREA elements do not submit their values in POST of GET.

I created input and select elements dynamically using javascript, but when I submitting the form the
the input and select elements do not submit their values.. Static input elements are submitting their values...

how can I resolve the problem...

thanks in advance
Dhanya

Weedpacket
05-14-2006, 08:12 AM
Last time I saw this it was due to a failing in IE. Certainly can't be PHP's fault.
But this works in Forefox, and IE6:<html><body>
<?php print_r($_GET);?>
<form id="stuff"><input type="submit"></form>
<script>
thisform = document.getElementById('stuff');
var field=document.createElement('input');
field.name= "foo";
field.value="wibble";
thisform.appendChild(field);
</script></body></html>