Posted By

apphp-snippets on 06/05/17


Tagged

iframe html post to


Versions (?)

Post Data to iFrame with HTML Only


 / Published in: HTML
 

URL: www.apphp.com/index.php?snippet=html-post-data-into-iframe

To send data into iFrame you don't need JavaScript or anything. You just have the form's target attribute match the iframe's name attribute. The outer page doesn't even reload. Copy this code and test it.

  1. <form action="iframe.php" target="my_iframe" method="post">
  2. <label for="text">Name:</label>
  3. <input type="text" name="full_name">
  4. <label for="text">Email:</label>
  5. <input type="text" name="email">
  6. <input type="submit" value="post">
  7. </form>
  8. <iframe name="my_iframe" src="iframe.php"></iframe>

Report this snippet  

You need to login to post a comment.