Forum: Ruby on Rails Getting field value from child window [Using Redbox]

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Unni K. (Guest)
on 2007-07-12 14:03
I have  a page in which I have a text field and next to that a button ,
when I click on the button it should open window [using Redbox] so that
I can type it in the window and when I give submit in the child window
it shuold close the child window automatically and the inserted value
should be added to the textbox in the parent window.

Please help
Akbar H. (Guest)
on 2007-07-12 14:44
(Received via mailing list)
This is javascript question. Imagine your textbox have id 'blabla'.

In your child window, your submit button must invoke this javascript
question:
top.opener.window.document.getElementById('blabla').value =
the_new_value;
window.close();

On Jul 12, 5:03 pm, Unni K. <removed_email_address@domain.invalid>
Unni K. (Guest)
on 2007-07-12 14:53
No, I want to use redbox, bcoz when entering data in the field of the
child window, I dont want to allow users to enter datas in the parent
window.

How to do that
Akbar H. (Guest)
on 2007-07-12 18:28
(Received via mailing list)
On Jul 12, 5:53 pm, Unni K. <removed_email_address@domain.invalid>
wrote:
> No, I want to use redbox, bcoz when entering data in the field of the
> child window, I dont want to allow users to enter datas in the parent
> window.
>
> How to do that
>

then you can just use
window.document.getElementById('blabla').value =
the_new_value;

I don't know the implementation of redbox. I assume redbox make "modal
window" not using child window. So redbox page is same as in parent
page.
This topic is locked and can not be replied to.