Support the ongoing development of →
Views Blade Forms
Last updated 2 years ago.
{!! Form::select('id_x', $x) !!}  //for Laravel 5

Thank your for your response mkblade,

However when I use the syntax:

{!! Form::select('id_x', $x) !!} 

I keep getting this JS error: "SyntaxError: missing ; before statement" in the 'id_x' of my Select.

Last updated 8 years ago.

Just a thought, try switch all single quotes to doubles and doubles to single?


Didn't work. Keep getting the same error. It is possible to use Blade syntax inside JS?


You can, tho I don't recommend doing it. Using Blades means you are likely doing it in PHP file instead. I think keeping .js files by itself will allow better performance since browser stores cache on client's computer to allow quicker access.

The error "SyntaxError: missing ; before statement" is too general for us to tell what has gone wrong. Please check your chrome debugger for further more information.

Just a reminder, in Javascript, you should avoid using straight newline, that sometimes might cause unexpected problems. (It seems to me you might be on that issue. ) Try use string concatenation instead.


var html = ""

html += "<table id='tablaRazas'>";
html += "<tr>";
// blah blah blah....

document.getElementById("nombreRaza").innerHTML = html
Last updated 8 years ago.

Sign in to participate in this thread!


Your banner here too?


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 - All rights reserved.