Nikhil Shrestha
Nikhil Shrestha

Reputation: 1540

Is it possible to set javascript value to <g:set var="x">

I am new to grails and I want to pass the value from jQuery to g:set tag

g:set var="totalPrice" value="${0.00}"

Upvotes: 0

Views: 166

Answers (1)

Trebla
Trebla

Reputation: 1172

No, this is not possible... the <g:set> tag executes on the server before the page is rendered to your browser. JavaScript processing happens in your browser after the data has been sent from the server.

You can perform jQuery processing and submit that via an AJAX request to a controller action, which can then render data back to the client based on the submitted data, but that's a little roundabout.

Upvotes: 2

Related Questions