Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Insert selection results to opener's form

Reply
Thread Tools

Insert selection results to opener's form

 
 
tomb
Guest
Posts: n/a
 
      11-05-2007
I only understand the popup mechanism on an elementary level, but my
task is a bit more complex than that. If anyone can provide a guideline
or point me to one I would be most appreciative.

I would like to add functionality like an email address book that opens
in a popup, and then the selected email addresses are populated to the
main window form text box. I can open the popup, and I can populate the
list of email addresses, but I don't get how to interact between the two
windows and send the results back to the main window.

Is there some way of sending a reference to the text box to the popup
window? If so, I can set the value. Or, if there is a better way than
that, I'm all for it.

Please help - I've been searching for this all night and day!

Thanks in advance.

Tom
 
Reply With Quote
 
 
 
 
SAM
Guest
Posts: n/a
 
      11-07-2007
tomb a écrit :
> I only understand the popup mechanism on an elementary level, but my
> task is a bit more complex than that. If anyone can provide a guideline
> or point me to one I would be most appreciative.
>
> I would like to add functionality like an email address book that opens
> in a popup, and then the selected email addresses are populated to the
> main window form text box. I can open the popup, and I can populate the
> list of email addresses, but I don't get how to interact between the two
> windows and send the results back to the main window.


In the popup

<select onchange="var k = this.selectedIndex;
if(k==0) alert('Make a choice in this list');
else {
opener.document.forms[0].email.value = this.options[k].value;
self.close();
}">
<option selected>e-mail contacts</options>
<option value="">Tartempion Marc</option>
<opt ...
</select>


In the main window

<form ... >
<p>e-mail : <input type=text name="email">
<a href="adBook.htm" onclick="adBook();" target="adbk">address book</a>

<script type="text/javascript">
function adBook() {
if(typeof(truc)=='undefined' || truc.closed)
truc = window.open('','adbk','width=300,height=500');
truc.focus();
}
</script>

--
sm
 
Reply With Quote
 
 
 
 
tomb
Guest
Posts: n/a
 
      11-08-2007
Merçi, beaucoup!

T

SAM wrote:
> tomb a écrit :
>> I only understand the popup mechanism on an elementary level, but my
>> task is a bit more complex than that. If anyone can provide a
>> guideline or point me to one I would be most appreciative.
>>
>> I would like to add functionality like an email address book that
>> opens in a popup, and then the selected email addresses are populated
>> to the main window form text box. I can open the popup, and I can
>> populate the list of email addresses, but I don't get how to interact
>> between the two windows and send the results back to the main window.

>
> In the popup
>
> <select onchange="var k = this.selectedIndex;
> if(k==0) alert('Make a choice in this list');
> else {
> opener.document.forms[0].email.value = this.options[k].value;
> self.close();
> }">
> <option selected>e-mail contacts</options>
> <option value="">Tartempion Marc</option>
> <opt ...
> </select>
>
>
> In the main window
>
> <form ... >
> <p>e-mail : <input type=text name="email">
> <a href="adBook.htm" onclick="adBook();" target="adbk">address book</a>
>
> <script type="text/javascript">
> function adBook() {
> if(typeof(truc)=='undefined' || truc.closed)
> truc = window.open('','adbk','width=300,height=500');
> truc.focus();
> }
> </script>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
selection structure nested within another selection structure 4Ankit@gmail.com Javascript 1 12-07-2006 11:47 AM
JTable with row selection, but no cell selection Simon Niederberger Java 2 01-07-2005 04:17 PM
JS comparing innerHTML to text selection (window.getSelection() /document.selection) Andrew Crowe HTML 1 09-13-2004 02:22 PM
How to change a range selection to text selection? Loebb Javascript 0 02-23-2004 02:12 PM
HOWTO autopost the selection list upon selection curiousity ASP .Net Mobile 0 11-21-2003 12:57 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57