Thank you. Only caveat to this solution is, every time someone access the
page, the model will be showing. An alternative solution will be to keep
the modal close untill the page is accessed, once the page is accessed
invoke the modal "open" by clicking the button. I would imagine the
javascript will need to be modified with
<button type="button" onclick="myFunction()" class="btn btn-info btn-lg"
data-toggle="modal" data-target="#myModal">Open Modal</button>
And then
<script>
$(function myFunction() { $('#myModal').modal('show'); });
</script>
But I am not a javascript expert, so I am sure there is something wrong may
be with this implementation.
On Wednesday, April 27, 2016 at 4:55:08 PM UTC-4, [email protected] wrote:
>
> Try:
>
> <script>
> $(function() { $('#myModal').modal('show'); });
> </script>
>
>
> On Wednesday, April 27, 2016 at 11:50:33 AM UTC-4, Ron Chatterjee wrote:
>>
>> I am having problem keeping the Modal to stay open an updated after the
>> form submission. Searching on the web all I see is to set the backdrop
>> (css) to static. So, I changed the css on the link as: <a href="#"
>> onclick="$('#myModal').modal({'backdrop': 'static'});" class="btn
>> btn-primary">My Modal</a>
>>
>> But the modal closes after the submission if I use the link. Same as
>> button.
>>
>>
>> db.define_table("Education",
>> Field("Title", "string", label='Title',
>> requires=IS_NOT_EMPTY(),default=None),
>> Field("filename", "upload", default=None,
>> uploadfolder=os.path.join(request.folder, 'uploads')))
>>
>>
>> def index():
>> form = SQLFORM(db.Education).process()
>> return dict(form = form)
>>
>>
>> #index.html
>>
>> {{extend 'layout.html'}}
>>
>> <div class="container">
>> <h2>Modal Example</h2>
>> <!-- Trigger the modal with a button -->
>> <button type="button" class="btn btn-info btn-lg" data-toggle="modal"
>> data-target="#myModal">Open Modal</button>
>>
>>
>> <!-- Modal -->
>> <div class="modal fade" id="myModal" role="dialog">
>> <div class="modal-dialog">
>>
>> <!-- Modal content-->
>> <div class="modal-content">
>> <div class="modal-header">
>> <button type="button" class="close"
>> data-dismiss="modal">×</button>
>> <h4 class="modal-title">Modal Header</h4>
>> </div>
>> <div class="modal-body">
>> <p>
>>
>> {{=form}}
>>
>> </p>
>> </div>
>> <div class="modal-footer">
>> <button type="button" class="btn btn-default"
>> data-dismiss="modal">Close</button>
>> </div>
>> </div>
>>
>> </div>
>> </div>
>>
>> </div>
>>
>>
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to the Google Groups
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.