changing form values in a different window

A

Alex Hunsley

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
 
A

Alex Hunsley

Alex said:
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".
 
R

Randy Webb

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.
 
A

Alex Hunsley

Randy said:
Alex Hunsley said the following on 9/28/2005 11:23 AM:



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)
 
A

Alex Hunsley

Alex said:
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.


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
 
R

Randy Webb

Alex Hunsley said the following on 9/28/2005 6:43 PM:

OK, the idea of popup blockers aside, you want a popup. OK.
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.
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.
 
R

Randy Webb

Alex Hunsley said the following on 10/1/2005 5:50 AM:
Alex said:
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.


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?
 
T

Thomas 'PointedEars' Lahn

Alex said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top