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 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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-- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> 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 > > -- > Posted viahttp://www.ruby-forum.com/.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > 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...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > 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 > > > > -- > > 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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---