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.
Mike D. (Guest)
on 2007-04-28 03: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
Mike D. (Guest)
on 2007-04-28 16:54
Can anyone help on this one?

Thanks!

Mike


Mike D. 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
Akbar H. (Guest)
on 2007-04-28 18: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 D. <removed_email_address@domain.invalid>
seth b. (Guest)
on 2007-04-28 21: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 <removed_email_address@domain.invalid> 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.