I need some help. I have a form with some inputs and he sorted with divs. I want to insert into the div more inputs so I tried to do something like this-
$(document).ready(function(){
$("#more").click(function(){
$("#div_name").append("<input type=\"text\" name\"test\" value=\"test\" />");
});
});
And the html is
<form action="" method="post" enctype="multipart/form-data" name="form_name">
<input type="text" name="text_input" value="test" />
<div id="div_name"></div>
<input type="button" id="more" value="Add more" />
</form>
And it's works and add the inputs great, but when I send the form he won't send the input that the jquery added because if I'll do print_r($_POST); he will show me all the posts except those I just added, so the output will be
Array
(
[text_input] => test
)
also when I used the jQuery code above. But when I'm doing $("form").append(...); , everything is going great but the input isn't in the div. Thank you. :)