The value entered in field "term" arrives to test.php but values in fields "AttrName" and "Attribute" does not, even without adding any more fields, addition of more fields works, but values are not sent.
Code:
<head>
<script src='https://code.jquery.com/jquery-1.12.4.min.js' integrity='sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ' crossorigin='anonymous'></script>
<script src='https://www.jqueryscript.net/demo/dynamic-forms-fields/js/dynamic-form.js'></script>
</head>
<body>
<form action='test.php' method='post'>
<input type='text' name='term' size='60' placeholder='term' required /><br />
<div id='dynamic_form'>
<input type='text' name='AttrName' placeholder='Attribute name' />: <input type='text' name='Attribute' placeholder='Atributte' />
<a href='javascript:void(0)' id='plus'> +</a>
<a href='javascript:void(0)' id='minus'> -</a>
</div>
<script>
var dynamic_form = $('#dynamic_form').dynamicForm('#dynamic_form','#plus', '#minus', {
// the maximum number of form fields
limit: 10,
});
</script>
<br />
<input type='submit' name='submit' id='submit' />
</form>
</body>
UNDATE
test.php:
<?php
echo $term=$_POST['term']."<br />";
echo $AttrName=$_POST['AttrName']."<br />";
echo $Attribute=$_POST['Attribute']."<br />";
?>
dynamicForm()even do here, since$('#dynamic_form')doesn't find anything? Can you demonstrate the state of the form when it's submitted, after it's been modified by this JavaScript? Or maybe provide a runnable example to demonstrate?print_r($_POST);to see what is getting posted.dynamic_form[dynamic_form][0][AttrName]