Short answer, no. Javascript is parsed client side, and PHP is parsed server side. Since PHP is compiled then sent to your browser, there is no longer an opportunity to parse a variable once it is at the client's browser. However, what can be done is use javascript, and submit a value via ajax back to PHP (server side), return a response from server. Then use that response to manipulate the DOM.
Thanks. Changed how the form flows--no longer relying on javascript except to do front end validation.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community