i am trying to create multiple tag field with jquery tag script that i got from http://codepen.io/k-ivan/pen/NxxGPv it works perfectly fine as it is but when i try to add more field by apending , the script stop working, why can anyone please help me tyvm :) here is my code
html
<form role="form" method="POST" enctype="multipart/form-data" action="../test.php">
<label for="default">Default
<input type="text" id="default" class="tagged form-control" name="tag-1" data-removeBtn="true" placeholder="create tag">
</label>
<input type="button" value ="add More" id="add">
<input type="submit" value="submit">
</form>
jquery for adding more field (adding works perfectly fine )
<script >
$(document).ready(function(){
var Count =2;
$('#add').click(function(){
$('#add').before($('<div/>',{
class:'row',
})
.fadeIn('slow')
.append(' <input type="text" id="default" class="tagged form-control" name="tag'+Count+'" data-removeBtn="true" placeholder="create tag">')
)
Count++;
});
});
</script>
I want to mention that i m using append this way becz there going to be many input field and will have php script inside this that is why. ty. With this question i also like to ask how can we add php script inside this append event ?