0

I have a form with an iframe inside, this iframe contains another form. This is the html skeleton :

<html>
    <form>

        <iframe src="..." id="form_iframe">
            //in this form I have another form with id = test_frame_id and name
        </iframe>

        <input type="submit" id="submit_button" value="save"/>
    </form>
</html>

So how can I submit two forms whan I clik on submit_button ? I tried in jQuery $("#test_frame_id").submit() but it's doesn't work

simon
  • 1,180
  • 3
  • 12
  • 33
  • Try trigger click http://api.jquery.com/trigger/ to simulate a button press on the submit button of your iframe when you click the button outside the iframe. – Rence Jun 27 '18 at 10:02
  • 1
    is it the iframe hosted on the same domain, if so use javascript: `myIframe.contentDocument.querySelector('form').submit();` – Hudson Jun 27 '18 at 10:02

0 Answers0