iframe

Hi,
I need to submit to the server without leaving the page.
ie; I have a form that collects data and when I hit submit, I don't want it to leave the page... I am not sure how to do it with iframes...
Thanks,
Meera
[251 byte] By [meeraarvind] at [2007-11-18 17:44:30]
# 1 Re: iframe
in the form element set the attribute target="myframe".
The result of the submit will then ben shown in the frame name myframe. And the current frame will stay the same.

am not sure how to do it with iframes...
Where does the iframe come in ?.
khp at 2007-11-8 0:19:09 >
# 2 Re: iframe
Can you show me an example? The normal process is:
get information from the form
submit it to the server
and post back to the same page.

I want to avoid the post back to the same page. So, I don't want to leave the page.

Thanks,
Meera
meeraarvind at 2007-11-8 0:20:07 >
# 3 Re: iframe
As I said, set the target attribute on the form element

<form target="myframe" action="www.cgi">
<button>hello</button>
</form>

If there is no frame in the current frameset, named myframe, a new window will be created to show the result of the request.
khp at 2007-11-8 0:21:05 >
# 4 Re: iframe
I did the following:
<FORM NAME=frmMainForm ACTION="changepassword.asp" METHOD=POST LANGUAGE=VBScript target=myFrame>
input fields
submit button.
</form>

<div style="visibility:hidden; position:absolute; top:-1000px; left:-1000px">
<iframe id="myFrame" src=""></iframe>
</div>

When I enter information and hit the submit button, it's opening a new window. I don't want that... it has to stay in the same window & update the information in the database.
How do I do that?
thanks,
meera
meeraarvind at 2007-11-8 0:22:06 >
# 5 Re: iframe
Originally posted by meeraarvind
When I enter information and hit the submit button, it's opening a new window. I don't want that...

Yes I already told you this would happen, if there is no frame named myframe in the current frameset. The solution is of course, to put a frame named myframe in the current frame set, ie. on the page.
khp at 2007-11-8 0:23:13 >