hi, 

is it possible to have bootstrap modal remains open when form errors?
e.g.
*#controllers/default.py*
def sale_order_header():
    form = SQLFORM(db.sale_order_header)
    form_customer = SQLFORM(db.customer)
    if form_customer.process().accepted:
        redirect(URL('sale_order_header.html') )
    elif form_customer.errors:
        #response.flash = 'form has errors'
        #response.js = "jQuery('#myModal').modal('show');"
        #response.js = "$('#myModal').dialog({autoOpen : true, modal : 
true, width : 'auto', title : 'Enquiry Form'});"
        #response.js = "$('#myModal').dialog('open').focus();"
        #response.js = "$("#myModal").modal({"backdrop": "static"});"
        #response.js = "$('#myModal').modal({ show: true });"
        response.js = "$('#myModal').modal('show');"
        #response.js = "$('#myModal').modal({ show: true });"
    if form.validate():
        
db.sale_order_header.insert(**db.sale_order_header._filter_fields(form.vars) 
)
        redirect(URL('sale_report', 'report_sale_order') )
    return dict(form = form, form_customer = form_customer)
    
*#views/default/sale_order_header.html*
{{extend 'layout.html'}}

{{=form}}

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" 
aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" 
aria-label="Close"></button>
        <h4 class="modal-title" id="myModalLabel">Customer</h4>
      </div>
      <div class="modal-body">
        {{=form_customer}}
      </div>
    </div>
  </div>
</div>

i've tested several way, but the result is not expected (no traceback 
errors, but the result is not expected). any idea?

thanks and best regards,
stifan

-- 
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.

Reply via email to