JSFiddle - React, Tailwind, and code Playground
by Ivan Ferrer
HTML
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.1/css/bootstrap-combined.min.css">
<br>
<a data-toggle="modal" data-id="123456" title="Add this item" class="open-AddBookDialog btn btn-primary" href="#addBookDialog">Testando</a>
<p> </p>
<div class="modal hide" id="addBookDialog">
<div class="modal-header">
<button class="close" data-dismiss="modal">×</button>
<h3>Modal header</h3>
</div>
<div class="modal-body">
<p>some content</p>
<form name="teste">
<input type="text" name="bookId" id="bookId" value=""/>
<input type="button" value="testar" onclick="exibir()"> </form>
</div>
</div>
JavaScript
$(document).on("click", ".open-AddBookDialog", function () {
var myBookId = $(this).data('id');
$(".modal-body #bookId").val( myBookId );
});
function exibir()
{
alert(document.teste.bookId.value);
}