Friday, 15 August 2014

jquery/javascript: Capture submit event from form in iframe? -


Let's say I have a web page with an iframe that has a form. The form is presented when I want to set a value in a hidden field. How can I trigger an event in the main page when the form is submitted?

This is a simple version of what I am trying to do:

     input type = "=" file " Submit "name =" submit "class =" submit "value =" upload "& gt; & lt; / form & gt; & lt; / iframe & gt; & lt; / body & gt; & lt;  

Try it out,

   Code> $ ('# upload-iframe'). Load (function () {$ (this) .contents (). ('# File_upload_form'). Submit (function () {$ ("input [name = 'file upload']"). Val ("some value "); // Update returns true; // return false submission prevents}};});   

sent from

might be duplicated

No comments:

Post a Comment