Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can a form be sent inside iframe?

I want to send a form to inside an iframe. How can i do this?

like image 417
Yunus Eren Güzel Avatar asked Dec 04 '22 23:12

Yunus Eren Güzel


1 Answers

The target attribute of form tag specifies where to open the action URL.

You can do like following :

<iframe name="myframe" id="frame1" src="mydetail.asp"></iframe>
<form action="../mydetail.asp" method="post" target="myframe">
<input type="submit" name="DoIt" value="DoIt">
</form>    

The target attribute is used with frames to specify the frame in which the form response should be rendered. If no frame with such a name exists, the response is rendered in a new window unless overridden by the user.

like image 142
Saurabh Gokhale Avatar answered Dec 07 '22 20:12

Saurabh Gokhale