I have code to initialize a modal window:
<script> var grid_modal_options = { height: 'auto', width: '80%', modal: true }; function showProductsModalBox() { $("#products_modal_box").dialog(grid_modal_options); $("#products_modal_box").parent().appendTo('form:first'); } </script> <div id="products_modal_box" title="Products" style="display: none;"> <div class="in"> <div class="grid-12-12"> <form id="products_modal_box_form" action="#" method="post"> <table> <thead> <tr> <th> </th> <th>Product</th> </tr> </thead> <tbody> <?php </tbody> </table> </form> </div> </div> </div>
and
<input type='text' id='products_id_textbox' name='products_id_textbox' /> <a href='#' onclick='showProductsModalBox(); return false;'>Choose products</a>
The code successfully displays the modal block. But how to return the "Product" selected by the user in the text box "products_id_textbox"? Thanks.
source share