Jump to content


Photo

Dynamically load MySQL Record ID to Twitter Bootstrap modal Popup Window

data modal popup jquery popup jquery modal

  • Please log in to reply
No replies to this topic

#1 NaniG

NaniG

    Advanced Member

  • Members
  • PipPipPip
  • 59 posts

Posted 28 October 2013 - 12:16 AM

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" /> &nbsp; <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" /> &nbsp; <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.

 

 






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com