Hi I am trying to include a {{ Form::text }} inside an inline javascript is this possible or I just got it wrong? thank you.
var html_ship = "<tr><td><div class='col-sku'> {{ Form::text('sku[]', '', array('class'=>'col-sku')) }}</div></td></tr>";
//add item
$("#add-item").on('click', function() {
$("#table-shipping tr:last").after(html_ship);
});
Thank you in advance for your response.
James
If the javascript is generated in a blade file this should be fine - what errors are you getting?
Try using ' instead of ". Form::text will wrap the attributes with quotes which is probably breaking your javascript.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community