简体   繁体   中英

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="???"/>

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM