Reputation: 70
I'm implementing various lists with modal option boxes. Picture a list of properties (found at www.keydataweb.co.uk/bootstrap/manageprops.php ) - When a user wishes to perform an action, I'm firing a Modal and need to pass it the ID of the property. I'm basing my approach to this heavily on a response I found on stack overflow, but once placed into the page It's ceasing to function. I'm thinking it may be something to do with my JS, but I'm not entirely sure how best to place it, or correct any current error I'm having:
$(document).on("click", ".open-delPropDialog", function () {
var propForDel = $(this).data('id');
$(".modal-body #propId").val( propForDel );
$('#delPropDialog').modal('show');
});
Here's a forked JSFiddle with my current code: http://jsfiddle.net/mxqUX/
The JSFiddle has been integrated to my page, but not styled yet so the two buttons are sat at the top.
Please Help!
Originally based on: (http://stackoverflow.com/questions/10626885/passing-data-to-a-bootstrap-modal)
Upvotes: 1
Views: 192
Reputation: 3070
What you have here in the code block:
$(".modal-body #propId").val( propForDel );
What you have in your JSFiddle and on your site:
$(".modal-body #delPropDialog").val( propForDel );
Fix your JSFiddle and your site to match the code that you have in your code block then you should be good to go.
Updated jsfiddle
Upvotes: 1