Posting a data to an iframe is very easy process. Just set the forms target to load in iframe.
<form action="iframe.php" target="t-iframe" method="post"> <label for="text">Firstname:</label> <input type="text" name="firstname" id="firstname"> <input type="submit" value="post"> </form> <iframe name="t-iframe" src="iframe.php"></iframe>
The main advantage of this your form will not reload when you submit the form. It feel like ajax operation but is not really ajax and it loads on the background.
Did this post help you?
Tutsplanet brings in-depth and easy tutorials to understand even for beginners. This takes a considerable amount of work. If this post helps you, please consider supporting us as a token of appreciation:
- Just want to thank us? Buy us a Coffee
- May be another day? Shop on Amazon using our links.
Your prices won't change but we get a small commission.
Leave a Reply