tmitch68
asked on
Implementing a Cancel button for a modal dialog in Ruby on Rails
Hello,
I have a Ruby-on-Rails web application with a modal pop-up dialog. All I want to do is implement a Cancel button that closes the dialog with no further work.
Sounds simple, and from everything I've found online, it should be simple.
The only problem is, nothing I've tried works. I've tried this...
<%= submit_tag("Cancel", {:onclick=>"window.close() "}) %>
and this...
<%= submit_tag("Cancel", :id => "Cancel")%>
<script language="javascript">
$j('#OK').click(function() {
window.close();
});
</script>
and this...
<%= submit_tag("Cancel", :id => "Cancel")%>
<script language="javascript">
$j('#OK').click(function() {
this.parent.close();
});
</script>
I don't get any errors - its just that the window won't close!!
Any suggestions?
Thanks in Advance,
Tim
I have a Ruby-on-Rails web application with a modal pop-up dialog. All I want to do is implement a Cancel button that closes the dialog with no further work.
Sounds simple, and from everything I've found online, it should be simple.
The only problem is, nothing I've tried works. I've tried this...
<%= submit_tag("Cancel", {:onclick=>"window.close()
and this...
<%= submit_tag("Cancel", :id => "Cancel")%>
<script language="javascript">
$j('#OK').click(function()
window.close();
});
</script>
and this...
<%= submit_tag("Cancel", :id => "Cancel")%>
<script language="javascript">
$j('#OK').click(function()
this.parent.close();
});
</script>
I don't get any errors - its just that the window won't close!!
Any suggestions?
Thanks in Advance,
Tim
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER