JSFiddle - React, Tailwind, and code Playground
by rostovtsev
HTML
<script src="http://twitter.github.com/bootstrap/assets/js/bootstrap.js"></script>
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">
<div data-toggle="modal" href="#comment-form-modal" id="23" href="#" feedback="{{ feedback.id }}" class="comments no">Click here 1</div>
<div data-toggle="modal" href="#comment-form-modal" id="24" href="#" feedback="{{ feedback.id }}" class="comments no">Click here 2</div>
<div id="comment-form-modal" class="modal hide fade" style="display: none; ">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h3>Comment on feedback</h3>
</div>
<!-- model window -->
<div class="modal-body">
<form id="comment_form" method="post">
<p class="validateTips"></p>
<input type="text" name="test"/>
<input type="hidden" name="test"/>
<input type="hidden" name="perform_logout">
</form>
</div>
<!-- model window -->
<div class="modal-footer">
<a href="#" class="btn btn-primary" id="comment-form-submit">Submit</a>
<a href="#" class="btn" data-dismiss="modal">Cancel</a>
</div>
</div>
JavaScript
$(document).ready(function() {
$(".comments.no").mouseover(function() {
myDivsId = this.id;
});
$('#comment-form-submit').click(function() {
$('#comment_form').submit();
alert('Handler for .submit() called + div\'s ID = ' + myDivsId);
return false;
});
});