javascript - Passing data-id to ColdFusion Query within (bootstrap) modal body -
i'm using method laid out in thread:
it works spot on. able pass data modal , display in field within form. question is: what's easiest way use data in coldfusion query within modal body?
modal button:
<a data-toggle="modal" data-id="495.00" title="view dates" class="open-registermodal btn btn-primary" href="#registermodal">test</a> javascript
<script type="text/javascript"> $(document).on("click", ".open-registermodal", function () { var myprice = $(this).data('id'); $(".modal-body #price").val( myprice ); }); </script> modal body query
<cfquery name="getdata" datasource="thedatabase"> select * table cost = (price above) </cfquery> i use same modal of buttons on page , change out data-id on each individual button. suggestions?
the general idea post through ajax. collect data want post use via .data() , post .cfm or .cfc?method=foo , values arrive in form scope or function's arguments in cf respectively.
Comments
Post a Comment