Hi
I want to load the mb_frontend_form using the fetch API. I can call the form successfully but the form does not include the necessary JS/CSS files. So just the form html loads. Any ideas why? or even if its is possible?
example.php
define( 'WP_USE_THEMES', false );
require_once( '../../../../../../wp-load.php' );
echo do_shortcode('[mb_frontend_form id="dc-product" submit_button="Update" ajax="true"]');
then in my themes js file...
<script>
let container = document.getElementById('content');
const testform = async () =>
{
const url = 'http://192.168.0.14/freestuffgroup/wp-content/plugins/drip-create-plugin/includes/functions/custom-scripts/metabox-form-query.php?rwmb_frontend_field_post_id=339';
fetch(url,{
method: 'GET'
})
.then(response => {
if (response.ok) {
return response.text();
}
})
.then(data => {
container.innerHTML += data;
}
})
};
testform();
</script>