/    Sign up×
Community /Pin to ProfileBookmark

controlling select box from a different window

Hey,

i have a window, that opens a window that lets the user enter a new sale into my web based inventory system. Now, before the user had to scroll through a list of customers and then choose the one that they want the sale attributed to. It was long and a waste of time. So now i have a search function (a link that opens a new popup with the search in it), once the user searches the database and finds the customer that they want to pick and clicks a button, i want the script to select the customer from the list in the second window. Here’s a diagram to help me explain:

window 1)main window-user clicks add new sale
window 2 opens
window 2)user enter in some info, clicks the search button
window 3 opens
window 3)after finding the customer, user clicks go and script selects the customer in the select box in window 2.

i thought that i might get it done with:

parent.Myform.myselect.options[myoptionIndex].selected = true;

but it doesn;t work and i havn’t been able to find anything really usful for my skill level in the tutorials and books that i have been reading on-line. Also i only need this to work in firefox if that helps any. Thanks in advance.

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@pj59Jan 05.2005 — Hello!

Are you able to post a link to what you already have?

Regards PJ (and greetings to the "Wheat Kings" if they still exist)
Copy linkTweet thisAlerts:
@PizentiosauthorJan 05.2005 — no i can't really, since it's live data. I am converting a desktop version that i made into a webapp, so the data i am working with is senative. however, below are some screen shots of the page in action to help me explain.

The menu on the first pic is CSS pop up menu.

**EDIT** i took the url out since i figured out the problem. **EDIT**

sorry i couldn't let you login, but i'd probally get in trouble from my bosses. I know it's not pretty right now, but once the coding side of things is done i am going to make it look better. Hope these help explain what i am trying to do. Thanks in advance, once agian.
Copy linkTweet thisAlerts:
@PizentiosauthorJan 06.2005 — I figured it out.

window.opener.MyForm.MySelect.options[MyIndex].selected = true;

that seems to work just the way that i wanted. Thanks for your help though.
×

Success!

Help @Pizentios spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...