By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,213 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

changing form values in a different window

P: n/a
I'm aware of how to access the document model in Javascript in order to
do things like change the values in the fields forms. However, I'd like
to pop up a helper window seperate from the page containing the form,
and when the user makes a selection and hits an 'ok' button in the
pop-up, I'd like their selectiont to be inserted into a field on a form
in the main window. Is this possible?

thanks
alex
Sep 28 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Alex Hunsley wrote:
I'm aware of how to access the document model in Javascript in order to
do things like change the values in the fields forms. ^^^^^^^^^^^^^^^
sorry, I meant "in the fields of forms".
However, I'd like
to pop up a helper window seperate from the page containing the form,
and when the user makes a selection and hits an 'ok' button in the
pop-up, I'd like their selectiont to be inserted into a field on a form
in the main window. Is this possible?

thanks
alex

Sep 28 '05 #2

P: n/a
Alex Hunsley said the following on 9/28/2005 11:23 AM:
I'm aware of how to access the document model in Javascript in order to
do things like change the values in the fields forms. However, I'd like
to pop up a helper window seperate from the page containing the form,
and when the user makes a selection and hits an 'ok' button in the
pop-up, I'd like their selectiont to be inserted into a field on a form
in the main window. Is this possible?


So, you want a popup window so that I can choose what I could have just
put in the form in the first place? That is a dumb idea unless your
users are stupid. If you want specific values, use a select list.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Sep 28 '05 #3

P: n/a
Randy Webb wrote:
Alex Hunsley said the following on 9/28/2005 11:23 AM:
I'm aware of how to access the document model in Javascript in order
to do things like change the values in the fields forms. However, I'd
like to pop up a helper window seperate from the page containing the
form, and when the user makes a selection and hits an 'ok' button in
the pop-up, I'd like their selectiont to be inserted into a field on a
form in the main window. Is this possible?

So, you want a popup window


Yes.
so that I can choose what I could have just
put in the form in the first place?
No, you couldn't practically 'just have put it in the form in the first
place':
it's not practical to put the items in a select list as there's more
than just simple text associated with each selection and I want a nice
presentation. And I don't want to burden the user with showing all the
info for selection (and the associated delay with getting it from the
database) unless they want to make a selection from all that info
anyway. Parts of the main form are optional.
That is a dumb idea unless your
users are stupid.


Why exactly is it dumb? (see above)



Sep 28 '05 #4

P: n/a
Alex Hunsley wrote:
Randy Webb wrote:
Alex Hunsley said the following on 9/28/2005 11:23 AM:
I'm aware of how to access the document model in Javascript in order
to do things like change the values in the fields forms. However, I'd
like to pop up a helper window seperate from the page containing the
form, and when the user makes a selection and hits an 'ok' button in
the pop-up, I'd like their selectiont to be inserted into a field on
a form in the main window. Is this possible?


So, you want a popup window

Yes.
> so that I can choose what I could have just
> put in the form in the first place?


No, you couldn't practically 'just have put it in the form in the first
place':
it's not practical to put the items in a select list as there's more
than just simple text associated with each selection and I want a nice
presentation. And I don't want to burden the user with showing all the
info for selection (and the associated delay with getting it from the
database) unless they want to make a selection from all that info
anyway. Parts of the main form are optional.
> That is a dumb idea unless your
> users are stupid.


Why exactly is it dumb? (see above)


[lack of any reply noted]

Randy, it's a shame that you're willing to wade into the thread only to
prematurely decry my needs as 'dumb', and not to actually offer any help
(or even to have the grace to acknowledge that the idea isn't dumb once
I'd made that clear).

Perhaps you're some sort of troll. Who knows?
over and out,
alex



Oct 1 '05 #5

P: n/a
Alex Hunsley said the following on 9/28/2005 6:43 PM:
Randy Webb wrote:
Alex Hunsley said the following on 9/28/2005 11:23 AM:
I'm aware of how to access the document model in Javascript in order
to do things like change the values in the fields forms. However, I'd
like to pop up a helper window seperate from the page containing the
form, and when the user makes a selection and hits an 'ok' button in
the pop-up, I'd like their selectiont to be inserted into a field on
a form in the main window. Is this possible?


So, you want a popup window

Yes.


OK, the idea of popup blockers aside, you want a popup. OK.
> so that I can choose what I could have just
> put in the form in the first place?


No, you couldn't practically 'just have put it in the form in the first
place':
it's not practical to put the items in a select list as there's more
than just simple text associated with each selection and I want a nice
presentation. And I don't want to burden the user with showing all the
info for selection (and the associated delay with getting it from the
database) unless they want to make a selection from all that info
anyway. Parts of the main form are optional.


OK, that makes sense. Kind of.

Anyway, in your popup, if you want to access a field named myField in
your main window, you could address it like this:

window.opener.document.forms['formName'].elements['myField'].value;

window.opener gives you a reference to the main window, then the rest is
just getting a reference to the field.

It's the predominant idea behind "Date Pickers" scripts.
> That is a dumb idea unless your
> users are stupid.


Why exactly is it dumb? (see above)


My personal belief that popups are stupid more than anything. Anyone
using Norton popup blocker (among many others) do not have the ability
to effectively open a popup window since the popup blocker inserts a
script block in the page redefining window.open.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Oct 1 '05 #6

P: n/a
Alex Hunsley said the following on 10/1/2005 5:50 AM:
Alex Hunsley wrote:
Randy Webb wrote:
Alex Hunsley said the following on 9/28/2005 11:23 AM:

I'm aware of how to access the document model in Javascript in order
to do things like change the values in the fields forms. However,
I'd like to pop up a helper window seperate from the page containing
the form, and when the user makes a selection and hits an 'ok'
button in the pop-up, I'd like their selectiont to be inserted into
a field on a form in the main window. Is this possible?


So, you want a popup window
Yes.
> so that I can choose what I could have just
> put in the form in the first place?


No, you couldn't practically 'just have put it in the form in the
first place':
it's not practical to put the items in a select list as there's more
than just simple text associated with each selection and I want a nice
presentation. And I don't want to burden the user with showing all the
info for selection (and the associated delay with getting it from the
database) unless they want to make a selection from all that info
anyway. Parts of the main form are optional.
> That is a dumb idea unless your
> users are stupid.


Why exactly is it dumb? (see above)

[lack of any reply noted]


I actually overlooked your reply to me, I have answered it now.
Randy, it's a shame that you're willing to wade into the thread only to
prematurely decry my needs as 'dumb', and not to actually offer any help
(or even to have the grace to acknowledge that the idea isn't dumb once
I'd made that clear).
I didn't decree your needs as dumb, I said the idea of a popup window
was dumb.
Perhaps you're some sort of troll. Who knows?


I have been called worse.

--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Oct 1 '05 #7

P: n/a
Alex Hunsley wrote:
I'm aware of how to access the document model in Javascript in order to
do things like change the values in the fields forms. However, I'd like
to pop up a helper window seperate from the page containing the form,
and when the user makes a selection and hits an 'ok' button in the
pop-up, I'd like their selectiont to be inserted into a field on a form
in the main window. Is this possible?


Yes. Using Google (Groups) you will find several examples (in this group).
PointedEars
Oct 16 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.