I'm trying to create a button which dynamically add input and since I'm using Zend framework I use this method to get the input from the Form file : <?php echo $this->formm->getElement('refA'); ?>
but I get this error : Uncaught SyntaxError: Unexpected identifier
and the jquery function for that add button is :
$(document).ready(function (){
var j = "<?php echo $this->formm->getElement('refA'); ?>";
$("#add-more").click(function(){
$(".row").append(j);
});
});
and when I click on that error it shows me where I have the error it seems like that it uses:
$(document).ready(function (){
var j = "<label for="refA" class="optional">Article:</label>
<select name="refA" id="refA" class="form-control">
<option value="test1" label="test1">test1</option>
</select>";
$("#add-more").click(function(){
$(".row").append(j);
});
});
is it possible to get the code generated in single line so I can make the button to work ?