jquery - Call controller action from bootstrap modal in grails -


i using grails 2.4.2 , bootstrap. need use bootstrap modal edit individual row on click button. means when click action button modal open form element. after giving value in modal field want press save change button call controller action not happening.can please me on please? here attempts below ::

the button form opening modal in edit form ::

<span>  <a href="" title="change file" data-toggle="modal" data-target="#mymodal">   <span class="glyphicon glyphicon-edit"></span>  </a> </span> 

my modal & elements ::

    <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel">     <div class="modal-dialog" role="document">         <div class="modal-content">             <div class="modal-header">                 <button type="button" class="close" data-dismiss="modal" aria-label="close"><span aria-hidden="true">&times;</span></button>                 <h4 class="modal-title" id="mymodallabel">edit add video</h4>             </div>              <g:form controller="video" action="updateaddvideo" method="put" enctype="multipart/form-data" >                 <div class="modal-body">                     <div class="panel panel-info">                         <div class="panel-heading">                             <h5>edit</h5>                         </div>                          <div class="panel panel-body">                             <div class="col-md-12">                                 <g:hiddenfield name="addvideoid" value=""/>                                 <div class="col-md-12">                                     <label>add title</label>                                     <g:textfield name="addtitle" required="" class="form-control"/>                                 </div>                                  <div class="col-md-12">                                     <label>upload add video</label>                                     <input type="file" id="videoname" name="videoname" required="" class="form-control"/>                                 </div>                             </div>                         </div>                     </div>                 </div>                  <div class="modal-footer">                     <button type="button" class="btn btn-default" data-dismiss="modal">close</button>                     <button type="button" class="btn btn-primary">save changes</button>                 </div>             </g:form>         </div>     </div> </div> 

it looks might need change <button> tags of type <input type="submit"...>. button element not automatically cause submit action when pressed, unless add code "onclick" property so. using input type submit button should tell form submit controller.

alternatively, grails "actionsubmit" tag, works g:form. grails documentation


Comments

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

Rendering JButton to get the JCheckBox behavior in a JTable by using images does not update my table -