Announcement Announcement Module
No announcement yet.
passing variables: please respond Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • passing variables: please respond

    I'm hoping to get a least one response this time. oauthlink and textfield. when the user click the oauthlink, i want the value of texfield to be added to the parameters of the oauthlink. I am currently using a set variable but it doesnt seem to work. here is a partial of my gsp view:

    HTML Code:
    <g:set var="myVar" value="${myField}"/>
    <g:oauthLink consumer='linkedin' returnTo="[controller:'profile', id:myVar ]" >            
    <img src="${createLinkTo(dir:'images', file:'log-in-linkedin-small.png')}" 
    style="border: 0; float: right"/>
     Email:  <g:textField  name="myField" value="" /> 
    when this gets sent to the controller, the value is null. for testing purposes, I have replaced the value of the set variable with a string and it works fine. I just can get the value of the text box. please, let me know if you have any suggestions. remember, if everyone assumes that someone else will respond, no one will


  • #2
    The value of 'myField' must come from the controller action in your example. Remember, GSP and tags are evaluated on the server, so user input must be provided by a previous request. If you want to modify that URL in the browser, you will have to use Javascript. Also remember that the data in a text field will only be passed to the server if you submit a surrounding form (unless you use Javascript).