Hi there,
I'm building a video uploading form.
I'm playing the submit form and edit form within an iFrame on the page where the uploader happens. The uploader has triggers for certain actions, for example upload started.
I'm trying to figure out how to communicate with the form and submit it. I've managed to do it with plain old javascript, but it submits the form and then redirects to the same form, rather than the custom redirect I have in my functions (to the edit post page). I've tried Jquery forms plugin, however this code below breaks the process
I tried with:
uppy.on('upload', (data) => {
console.log('Starting upload')
var addFiles = document.querySelector('.uppy-DashboardAddFiles');
var uploadArea = document.querySelector('.uppy-Dashboard');
addFiles.style.display = 'none';
uploadArea.style.height = '50px';
console.log('Reduced uploader size.')
(function($) {
$('#video-forms').contents().find('cred_form_3371360_1')[0].submit()
console.log('Clicked submit button')
})( jQuery );
})
uppy.on('complete', (result) => {
console.log('Upload complete! We’ve uploaded these files:', result.successful)
})
#video-forms is iframe id.
But this doesn't seem to work. Is there a way to trigger a javascript event to submit the form?