how to prevent fancybox2 modal from closing until user clicks the actual close button? - ruby-on-rails

I'm hoping to use Fancybox2 to display a modal edit form for a rails 3.2 application, but if the end user clicks anywhere outside the modal window then fancybox closes.
Is there a way to disable that so the modal will not close (throwing away their edits) if they accidentally click on the underlying web page?
If not, can anyone suggest a simple rails 3.2 gem to implement modal popup form editing?

Related

Modal window don't work times to times in any browser

I create application on ruby on rails and add modal window for login. I put modal code in partial layouts/header. I expect it must work on every page of my app but not. Modal don't open in home/index. It's start work on home/about. I don't understand why. I'll update my ask If needs code. Can anyone help me understand?
I try to move modal code on another pages but get same effect.
home/index and home/about is URI?
Make sure you use the same layout (header file) and the modal element exist in HTML of home/index (you can use dev tool - f12 for checking)
Please, Does the modal need to be triggered by a button or something?

Bootstrap Modal with link not closing properly

i'm using the bootstrap modal in my rails application with a link in it (my modal shows an overview of a booking, the link directs to the details page). Clicking the details link is alright but when going back with the browser, I have to reload the page because nothing is clickable anymore. It seems as if the modal wasn't closed before clicking the details link.
Adding "data-dismiss" to the details links doesn't work.
Maybe it's an issue with turbolinks? Thanks!

Open Modal Form from other Modal Form JQuery

I'm using a JQuery Modal Form for ask some question to the user, I want that when the user click on OK button (Create an account for demo) open other JQuery Modal Form....
How Can I do it?

Link from modal in modal

I am using VirtueMart 2.0.10 and Joomla 2.5 and the products page is set to open in a modal popup. In this way any additions to the cart trigger a second modal (modal in modal, if you like) that includes links. At the moment the links open in the first modal that opened, but I would like the pages to open in the original window from where we started.
How do I modify the href links to open in the original window not in the modal popup? Or do I need to write some script for this?
Thanks for any help!!!

Twitter Bootstrap Closing Modal

I'm using the Twitter Bootstrap to make a project that opens modals with buttons. Each modal closes if you click on the same button that opens it. The modals will also close if you press escape or click on the background. However, if you click on the button to open one modal and then the button for another modal, the code opens both modals. If any modal is open, I want it to close when you click anywhere else on the page, including any of the other buttons. I'm really lost with the JavaScript, though.
Your question appears vague, so I will try to touch most of the points so that your question gets answered.
If you want the modal should not close on pressing esc or clicking some where else then try this....
<a data-controls-modal="your_div_id" data-backdrop="static"
data-keyboard="false" href="#">
To show a modal. use this inside a javascript function:
$('#myModal').modal('show')
To hide a modal use this:
$('#myModal').modal('hide')
To toggle a modal use this:
$('#myModal').modal('toggle')
Use these according to your need, hide a modal when you need may be on a button click.
I think this much is sufficient to achieve whatever you need.
If anything you aren't able to get something please post a comment.
Cheers!!!

Resources