Dynamically opening CDBT in modal page
-
Hi,
I am trying to create a generic modal page that can dynamically show cdbt entry form for adding new data. I am trying to pass the table name through the button and using the value attribute to dynamically add a cdbt short code to the modal page. Below is the code.
$(‘.myNewModal’).on(‘click’, function(event){
event.preventDefault();
var tbl= “[cdbt-entry table=’wp_spqfxajp1c_” + $(this).attr(‘value’) + “‘ bootstrap_style=’true’ display_title=’true’]”;
$(‘#myNModal’).modal(‘show’);
$(‘#myNModal iframe’).attr(‘src’, tbl);});
However, my webpage link is added to the short code and hence giving an error. The short code looks like this “https://oshparks.org/training/%5Bcdbt-entry%20table=’wp_spqfxajp1c_Training’%20bootstrap_style=’true’%20display_title=’true’%5D”.
Can you please let me know how I can dynamically add the shortcode without having the issue mentioned above.
Thanks,
Girishhttps://www.ads-software.com/plugins/custom-database-tables/
- The topic ‘Dynamically opening CDBT in modal page’ is closed to new replies.