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.
Dcd590295f2a350045dce2f322b9fc4f?d=identicon&s=25 Unni Krishnan (unnikrishnanes)
on 2007-07-12 12: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
05337aed68267daec2996e5ca732d476?d=identicon&s=25 Akbar Home (rinda)
on 2007-07-12 12: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 Krishnan <rails-mailing-l...@andreas-s.net>
Dcd590295f2a350045dce2f322b9fc4f?d=identicon&s=25 Unni Krishnan (unnikrishnanes)
on 2007-07-12 12: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
05337aed68267daec2996e5ca732d476?d=identicon&s=25 Akbar Home (rinda)
on 2007-07-12 16:28
(Received via mailing list)
On Jul 12, 5:53 pm, Unni Krishnan <rails-mailing-l...@andreas-s.net>
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.