2014-09-21 2 views
0

오늘 프로젝트를 완료하려하지만 편집 한 모든 편집 버튼을 클릭해도 편집 기능이 작동하지 않는다는 것을 알아 냈습니다. 하나의 특정 모달로 표시 할 각 데이터를 표시해야했습니다. 여기어떻게 부트 스트랩의 모달 값을 전달할 수 있습니까?

내가 한 일입니다 : 내 의견에 대한

<?php 
foreach ($allhealthlist as $row): 

    echo '<tr>'; 
    echo '<td>' . $row['HI Name'] . '</td>'; 
    echo '<td>' . $row['Ownership'] . '</td>'; 
    echo '<td>' . $row['District'] . '</td>'; 
    echo '<td>' . $row['VDC'] . '</td>'; 
    echo '<td>' . $row['Type'] . '</td>'; 
    echo '<td>'; 
?> 


<div class="col-md-1"> 
    <div id="myModal" class="modal fade in" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" > 
    <div class="modal-dialog"> 
     <div class="modal-content"> 

      <div class="modal-header"> 
      <a class="btn btn-default" data-dismiss="modal"><span class="glyphicon glyphicon-remove"></span></a> 
      <h4 class="modal-title" id="myModalLabel">Heath Institute</h4> 
      </div> 
      <div class="modal-body"> 

      <div class="panel panel-default"> 
       <div class="panel-heading"><h3 class="panel-title"><strong>Edit Information </strong></h3></div> 
       <div class="panel-body"> 



       <form role="form"> 
       <div class="form-group"> 
        <label class="hide">ID</label> 
        <input type="email" class="form-control hide" id="exampleInputEmail1" name="healtid" value="<?php echo $row['ID']; ?>"> 
       </div> 

       <div class="form-group"> 
        <label for="exampleInputEmail1">HI Name</label> 
        <input type="email" class="form-control" id="exampleInputEmail1" name="healthname" value="<?php echo $row['HI Name']; ?>"> 
       </div> 
       <div class="form-group"> 
        <label for="exampleInputEmail1">Ownership</label> 
        <input type="email" class="form-control" id="exampleInputEmail1" name="ownership" value="<?php echo $row['HI Name']; ?>"> 
       </div> 
       <div class="form-group"> 
        <label for="exampleInputPassword1">District</label> 
        <input type="password" class="form-control" id="exampleInputPassword1" name="district" value="<?php echo $row['HI Name']; ?>"> 
       </div> 
       <div class="form-group"> 
        <label for="exampleInputPassword1">VDC</label> 
        <input type="password" class="form-control" id="exampleInputPassword1" name="vdc" value="<?php echo $row['HI Name']; ?>"> 
       </div> 
       <div class="form-group"> 
        <label for="exampleInputPassword1">Type</label> 
        <input type="password" class="form-control" id="exampleInputPassword1" name="type" value="<?php echo $row['HI Name']; ?>"> 
       </div> 

       </form> 
       </div> 
      </div> 
      </div> 

      <div class="modal-footer"> 
       <div class="btn-group"> 
       <button class="btn btn-danger" data-dismiss="modal">Cancel</button> 
        <button class="btn btn-primary">Update</button> 
       </div> 
      </div> 
     </div><!-- /.modal-content --> 
     </div><!-- /.modal-dalog --> 
     </div><!-- /.modal --> 
     <a data-toggle="modal" href="#myModal" class="btn btn-primary" >Edit</a> 
     </div> 

<?php 
    echo '</td>'; 
    endforeach; 
?> 

답변

0

더 나은 당신이 모달은 당신이 원하는 그 값을 설정할 수 있습니다 열 때 다음, 자바 스크립트 객체에 데이터를 저장하는 것입니다.

관련 문제