Sarit Rotshild
Sarit Rotshild

Reputation: 391

Grails- how to get the value of specific input through <g:set> in the gsp

I have the following input:

  <input type="text" class="signup-input invitee" rows="1" id="invite${i}" name="invitees[${i}].user" data-partInvitee="${i}" placeholder="Enter name"/>

I want to use , but I don't know how to get the value of the input.

<g:set var="currentVal" value="???"/>

Upvotes: 0

Views: 902

Answers (1)

Lewis Norton
Lewis Norton

Reputation: 7151

You can't get the value of the input using g:set as gsps are rendered on the server before being shown in the browser. The value of the input can change after "currentVal" has been set.

You will need to use Javascript to solve this problem.

Upvotes: 1

Related Questions