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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.