Popup hell - submit & close

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

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

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. [email protected]

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 :wink:

On 4/28/07, rinda [email protected] 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 forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs