S
SamuelXiao
Hi,
I am trying to submit a form in a parent window by using its child
window.
Given there are a parent window and a child window, child window has
code like this:
function submitOpenerForm(){
var ope = window.opener.document.getElementById("input1").value =
"hardcode";
window.opener.document.getElementById("btn1").click();
window.close();
}
The code works for submitting but the parent window always refresh
after that, my question is, how can it click the button, processing
the form submit, but the parent page will not refresh?
For some reason, I can't use window.opener.document.getElementById
('form1').sumbit() bla bla to submit that form.
I know Ajax can submit form without refresh the page, but it needs a
url, and those data, my case is that, I am not sure those data are (or
are from which fields,input,so on), but I do know there is an input
element needed to be assigned value and there is only a submit
button.
Is there any way I can prevent it refreshing the page after click()?
I am trying to submit a form in a parent window by using its child
window.
Given there are a parent window and a child window, child window has
code like this:
function submitOpenerForm(){
var ope = window.opener.document.getElementById("input1").value =
"hardcode";
window.opener.document.getElementById("btn1").click();
window.close();
}
The code works for submitting but the parent window always refresh
after that, my question is, how can it click the button, processing
the form submit, but the parent page will not refresh?
For some reason, I can't use window.opener.document.getElementById
('form1').sumbit() bla bla to submit that form.
I know Ajax can submit form without refresh the page, but it needs a
url, and those data, my case is that, I am not sure those data are (or
are from which fields,input,so on), but I do know there is an input
element needed to be assigned value and there is only a submit
button.
Is there any way I can prevent it refreshing the page after click()?