Forum Moderators: open

Message Too Old, No Replies

help? script like getting email from address book in yahoo

         

geffchang

8:43 am on Dec 2, 2004 (gmt 0)

10+ Year Member



hello:

i'm a noob, and i'd like to know how the yahoo people do their stuff. in yahoo!mail, when you click the compose button, you are sent to a page where you write your mail. when you click the "insert addresses" link just above the "to" textbox, a new page containing a list of contacts opens with their corresponding chckboxes. when you press the "insert checked contacts" button, the values are displayed in the "to" textbox in the previous page.

is there any tutorial on how to achieve this using php and javascript? or would anyone be kind enough to show me how to do this. thank you.

eltreno

9:46 am on Dec 3, 2004 (gmt 0)

10+ Year Member



this is done via referencing the parent page

basically the parent page is the page where you would click addresses, that then opens the child page which references the parent page.

So when you add addresses in you child page ie click checkboxes etc then click insert addresses, javascript kicks in here doing something like this

first you can get values of all checked addresses and put them into a variable(myaddresses) seperated by ; for example

then say

opener.parent.formname.tobox.value = opener.parent.formname.tobox.value + myaddresses;

where
formname: is the parents page form name
tobox: is the To: textfield you type your addresses

I did the addition to make sure you keep the addresses you may already have in their

this is fairly simply explination hope it helps

I learnt alot of this stuff years ago on www,webmonkey.com try searching for window.opener on their site for memory you'll get some info regarding moving info between pages via javascript

Good Luck
Trent

geffchang

2:53 pm on Dec 3, 2004 (gmt 0)

10+ Year Member



maybe i should be more specific:

first off, i have a page with a form. the form has several textboxes. one textbox is to be inputted with a hotel code. but because codes are very difficult to memorize, i add a link beside the textbox which says "Hotel List". when i click this link, it opens a new page with a list of hotels (with checkboxes before their names, and a submit button).

now, you would think i could do this with a drop-down box. but, i want it in a separate page because in the form, there is a text box that says location. and i want to pass this value when i click the "Hotel List" link. it's something like href="hotellist?location=the_value_in_location_textbox"

back to the first paragraph.. when i check a hotel, and press submit, the name of that hotel appears in the hotel textbox in the first page.

anybody to help me?