Thameera
1 year ago

pass javascript variable into blade inside javascript

Posted 1 year ago by Thameera

$('#dynamic_field').append('Select a product... @foreach ($states as $service)\n' + ' {{ $service->name }}\n' + ' @endforeach {!! Form::text('code[]', null, array('class' => 'form-control', 'placeholder' => 'Enter code','id'=>'code[]')) !!}{!!Form::text('unit[]', null, array('class' => 'form-control', 'placeholder' => 'Enter unit','id'=>'unit')) !!}X'); }); this is my code here i have to pass javascript variable into input form but it doesnt work my code is this var test="test"; $('#unit').val(test);

Please sign in or create an account to participate in this conversation.