javascript - Passing id to modal box -


i want pass id modal box table showing data database when click on edit button specific information against appear on modal box editing.

here html modal , table

<table class="table table-striped table-bordered bootstrap-datatable datatable responsive">     <thead>         <tr>             <th>hall name</th>             <th>description</th>             <th>capacity</th>             <th>price</th>             <th>action</th>         </tr>     </thead>     <?php foreach ($data $item) { ?>     <tbody>         <tr>             <td class="center">                 <?php echo $item->hallname; ?></td>             <td class="center">                 <?php echo $item->description; ?></td>             <td class="center">                 <?php echo $item->capacity; ?></td>             <td class="center">                 <?php echo $item->price; ?></td>             <?php $i++; ?>             <td class="center"> <a class="btn btn-info" href="#openmodal">                     <input type="hidden" class="modalbtn" value="decre" onclick="popupwindow(this.id)" id="<?php echo $item->id;?>" />                     <i class="glyphicon glyphicon-edit icon-white"></i>                      edit                 </a>  <a class="btn btn-danger" href='<?php site_url(' admin/deleteuser/$item->id');?>' >                      <i class="glyphicon glyphicon-trash icon-white"></i>                     delete                  </a>              </td>         </tr> </table> 

below code modal. modal having form use edit specific data table.

<div id="openmodal" class="modaldialog">     <div> <a href="#close" title="close" class="close">x</a>           <h2>edit user</h2>          <?php echo $item->id; ?>         <?php echo form_open_multipart( 'admin/updatehall'); ?>         <div class="box-body">             <div class="row">                 <div class="col-md-3">                     <div class="form-group">                         <label>hall name</label>                     </div>                 </div>                 <div class="">                     <div class="col-md-6" style="padding-bottom: 14px">                         <input type="text" class="text-field" placeholder="hall name..." name="hallname" value='<?php echo $item->hallname; ?>'>                     </div>                 </div>             </div>             <div class="row">                 <div class="col-md-3">                     <div class="form-group">                         <label>description</label>                     </div>                 </div>                 <div class="">                     <div class="col-md-6" style="padding-bottom: 14px">                         <textarea class="text-field" placeholder="max 250 words" name="description" value='<?php echo $item->description; ?>' style="height: 120px"></textarea>                     </div>                 </div>             </div>             <div class="row">                 <div class="col-md-3">                     <div class="form-group">                         <label>capacity</label>                     </div>                 </div>                 <div class="">                     <div class="col-md-6" style="padding-bottom: 14px">                         <input type="text" class="text-field" placeholder="max capacity.." name="capacity" value='<?php echo $item->capacity; ?>'>                     </div>                 </div>             </div>             <div class="row">                 <div class="col-md-3">                     <div class="form-group">                         <label>price</label>                     </div>                 </div>                 <div class="">                     <div class="col-md-6" style="padding-bottom: 14px">                         <input type="text" class="text-field" placeholder="price/person.." name="price" value='<?php echo $item->price; ?>'>                     </div>                 </div>             </div>             <div class="row">                 <div class="col-md-3">                     <div class="form-group">                         <label>image</label>                     </div>                 </div>                 <div class="">                     <div class="col-md-6" style="padding-bottom: 14px">                         <input type="file" name="userfile" id="upload_file">                     </div>                 </div>             </div>             <div class="row">                 <div class="col-md-offset-4 col-md-6" style="padding: 11px;text-align: center;">                     <button type="submit" class="btn btn-primary" style="width: 108px;height: 31px;border-radius: 0px;background-color:#8cc63e;border:none" name="submit">submit</button>                 </div>             </div>         </div>         </form>     </div> </div> 


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -