I have a problem with dynamically appended form elements.
I have used this code to append form elements
$('#wrap_range_'+id).append("<div style='clear:both; margin:0;'></div>
<select name='range_"+id+"[]'>
<option value=''>-- Select range --</option>
<?php
for($cnt=10; $cnt<500; $cnt+=10) {
echo '<option value=\"'. ($cnt-10) . '-' . $cnt.'\">'. ($cnt-10) . ' - ' . $cnt .'</option>'; }
?>
</select>
<input type='text' name='range_discount_"+id+"[]' >
");
the forn elements are appended successfully, the name attribute of the fields are as i require.
But the problem is that when the form submits the dynamically开发者_高级运维 appended elements are not being posted.
Please guide me. Thanks in advance.
This isn't an answer but I can't seem to comment. What is wrap_range+id. Is it the form or a div or span inside the form? If it isn't the form make sure that it is between the and . Also how do you know that they're not submitting i.e. what are you doing that you expect values in the dynamically added fields and are not getting them?
精彩评论