HighDots Forums  

Click submit button without refresh

Javascript JavaScript language (comp.lang.javascript)


Discuss Click submit button without refresh in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
SAM
 
Posts: n/a

Default Re: Click submit button without refresh - 11-04-2009 , 09:17 AM






Le 11/4/09 1:30 PM, SamuelXiao a écrit :

Quote:
Actually, in my case, the opener window doesn't have a form element
(no <form>).
So, on my idea, you can't 'click' that button by JS.
(only cickable elements of forms are JS clickable)


Quote:
For submitting data, it has buttonhandler (a javascript
function) for those button (submit button). So "target" is not able to
be used in the opener window's "form".
Why won't you launch directly that function declared in the mother,
instead ?

if(opener &&
opener.myFunction)
opener.myFunction(document.getElementById('myValue ').value);


Quote:
But the way, thanks for your idea, now I make a copy of the opener
window's input fields in the "child" window, set it in a form, then
submit by using target, but it will popup another window "other", then
close. Is there anyway not allowing a new window popup by
target="other"? I am not allowed to use iframe.
in the popup
you need no target as you're function is supposed to close it.
(just think to put a little delay before to close)

if no function or no self-closing in end of it :

<form action="mytest.php" onsubmit="setTimeout('self.close()',100)">
Answer : <input type="text" name="answer">
<input type="submit">
</form>


if(opener &&
opener.myFunction)
{
opener.myFunction(document.getElementById('myValue ').value);
setTimeout('self.close()',500);
}



--
sm

Reply With Quote
  #12  
Old   
SamuelXiao
 
Posts: n/a

Default Re: Click submit button without refresh - 11-06-2009 , 09:37 AM






On Nov 4, 10:17*pm, SAM <stephanemoriaux.NoAd... (AT) wanadoo (DOT) fr.invalid>
wrote:
Quote:
Le 11/4/09 1:30 PM, SamuelXiao a écrit :



Actually, in my case, the opener window doesn't have a form element
(no <form>).

So, on my idea, you can't 'click' that button by JS.
(only cickable elements of forms are JS clickable)

For submitting data, it has buttonhandler (a javascript
function) for those button (submit button). So "target" is not able to
be used in the opener window's "form".

Why won't you launch directly that function declared in the mother,
instead ?

if(opener &&
* * opener.myFunction)
opener.myFunction(document.getElementById('myValue ').value);

But the way, thanks for your idea, now I make a copy of the opener
window's input fields in the "child" window, set it in a form, then
submit by using target, but it will popup another window "other", then
close. *Is there anyway not allowing a new window popup by
target="other"? *I am not allowed to use iframe.

in the popup
you need no target as you're function is supposed to close it.
(just think to put a little delay before to close)

if no function or no self-closing in end of it :

form action="mytest.php" onsubmit="setTimeout('self.close()',100)"
Answer : <input type="text" name="answer"
input type="submit"
/form

if(opener &&
* * opener.myFunction)
* {
* *opener.myFunction(document.getElementById('myValu e').value);
* *setTimeout('self.close()',500);
* }

--
sm
thanks all, the problem has been solved.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.