Forum: Ruby on Rails popup hell - submit & close

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.
Befa945ac6d3bf13c4b41657e8558f85?d=identicon&s=25 Mike Dershowitz (dersh53)
on 2007-04-28 01:11
Hi:

I've created a popup I'm desperately trying to close.  It's just not
working.  I've got a simple form_for with a submit tag. I put in an
onclick method and that's not doing it.  Can anyone help?

Here's the submit_tag:

<%= submit_tag "Send!", :onclick => "javascript: window.close();" %>

When I do this, the submit method fires and my DB is updated fine, but
the close never happens.

Then, after the db insert, I get a message:

Missing template ./script/../config/../app/views/tasks/create.rhtml

Can anyone explain what's going on?

Thanks so much in advance!

Mike
Befa945ac6d3bf13c4b41657e8558f85?d=identicon&s=25 Mike Dershowitz (dersh53)
on 2007-04-28 14:54
Can anyone help on this one?

Thanks!

Mike


Mike Dershowitz wrote:
> Hi:
>
> I've created a popup I'm desperately trying to close.  It's just not
> working.  I've got a simple form_for with a submit tag. I put in an
> onclick method and that's not doing it.  Can anyone help?
>
> Here's the submit_tag:
>
> <%= submit_tag "Send!", :onclick => "javascript: window.close();" %>
>
> When I do this, the submit method fires and my DB is updated fine, but
> the close never happens.
>
> Then, after the db insert, I get a message:
>
> Missing template ./script/../config/../app/views/tasks/create.rhtml
>
> Can anyone explain what's going on?
>
> Thanks so much in advance!
>
> Mike
05337aed68267daec2996e5ca732d476?d=identicon&s=25 Akbar Home (rinda)
on 2007-04-28 16:15
(Received via mailing list)
Maybe this is the case. You click the submit button, it bring you to
the new page. So the javascript does not work because you are already
in new page. You should put window.close function in the new page
(your missing template).

On Apr 28, 6:11 am, Mike Dershowitz <rails-mailing-l...@andreas-s.net>
Efe398b3b5436b0a8d4430090e8f86ea?d=identicon&s=25 seth b. (subimage)
on 2007-04-28 19:11
(Received via mailing list)
Instead of using a popup window, how about something a little more
slick?

http://sublog.subimage.com/articles/category/submodal

It's designed for such situations as yours ;)

On 4/28/07, rinda <akbarhome@gmail.com> wrote:
> >
> >
> > --
> > Posted viahttp://www.ruby-forum.com/.
>
>
> >
>


--
--------------------
seth at subimage interactive
-----
http://www.subimage.com
http://sublog.subimage.com
-----
http://www.getcashboard.com
http://dev.subimage.com/projects/substruct
This topic is locked and can not be replied to.