Jump to content

Dynamically load MySQL Record ID to Twitter Bootstrap modal Popup Window


NaniG

Recommended Posts

Hi to all,

 

I have an jquery modal popup window. So now I want to pass value of recid to modal popup window.

 

HTML Code :

<a href="#widget-config #ADD" id="<?php echo $row->recid; ?>" data-toggle="modal" class="btn btn-small add" data-rec-id="<?php echo $row->recid; ?>"><i class="icon-plus"> </i> Add</a>

PHP Code :

<div id="widget-config">
        <div id="ADD" class="modal hide">
                <div class="modal-header">
                        <button data-dismiss="modal" class="close" type="button">×</button>
               		<h4>Add Record</h4>
                </div>
                <div class="modal-body">
               			<p>Are you sure you want to Add Mr.ABCD as Student</p>
               			<p><input type="submit" value="Add" class="btn btn-small" name="AddStudent" />   <input type="reset" name="no" class="btn btn-small" value="No"data-dismiss="modal" /></p>
            		</div>
        </div>

I tried like below. But am not able to get the recid which is from MySQL table.

<div id="widget-config">
        <div id="ADD" class="modal hide">
         <form name="formAddStudent" id="formAddStudent" method="post" action="AddStudent.php">
               <script language="javascript">
               $("a.add).click(function(e){
                        var _id;
                        e.preventDefault();
                        var _id = $(this).attr('id');                           
               });
                </script>
                <div class="modal-header">
                        <button data-dismiss="modal" class="close" type="button">×</button>
               		<h4>Add Record</h4>
                </div>
                <div class="modal-body">
               			<p>Are you sure you want to Add Mr.ABCD as Student</p>
               			<p><input type="submit" value="Add" class="btn btn-small" name="AddStudent" />   <input type="reset" name="no" class="btn btn-small" value="No"data-dismiss="modal" /></p>
            	</div>
               </form?
        </div>
</div>

Please help me out from these....!

 

Thanks in advance.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.