Announcement Announcement Module
Collapse
No announcement yet.
Having a problem with g:formRemote tag, can't update div Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Having a problem with g:formRemote tag, can't update div

    Hi

    I am new to grails and try to learn g:formRemote tag.
    I am using latest grails. I have a simple following page. I have jquery1.7.2 library in a same folder.
    When I submit form, it open page in a new window, instead of opening in a div "comboDiv22244".

    Code:
    <!doctype html>
    <html>
    <head>
    <title>Toggle Div Page</title>
    <meta name="layout" content="main">
    <link rel="stylesheet" href="${resource(dir: 'css', file: 'errors.css')}" type="text/css">
    
    <g:javascript library="jquery" plugin="jquery1.7.2"/> 
    
    </head>
    <body>
    
    <div>
       <div>
    	 <h1>Combobox AJAX Testing............</h1>
    
    	  <g:formRemote name="myForm" update="comboDiv22244"  url="[controller: 'toggleDivPage', action: 'showComboResponse']">
    
    	      <select id="servicesoffered" name="servicesoffered" onchange="submit()" /> 
    
    		       <option value="blank">Please choose a type of service</option>
    		       <option value="1">Option A</option>
    		       <option value="2">Option B</option>
    		       <option value="3">Option C</option>
    
    	      </select>
    
    	  </g:formRemote>
    
    	   <div id="comboDiv22244">
    		==========Combo response page goes here main=========
    	   </div>  
       </div>
    </div>
    
    </body>
    </html>
    Please can someone adive me or can someone provide working example.

    Thanks
    Last edited by Andrew Eisenberg; Aug 24th, 2012, 11:34 AM. Reason: formatting

  • #2
    Moving this to the grails forum since it is more appropriate there.

    Comment

    Working...
    X