thanks all, i've tried both but got unexpected result (no error occured)
*- iframe* : the other modal is loaded too status loading ... (because i 
have a modal that have a modal on it (modal raw material have another modal 
name modal category) )
*code*
views/transaction_purchase/purchase_order_form.html
{{=form}}

<!-- modal raw_material -->
<div class="modal fade" id="modal_raw_material" 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"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{=DIV(T('Raw Material') ) }}</h4>
</div>
<div class="modal-body">
{{=IFRAME(_src = 
'http://127.0.0.1:8000/me/transaction_purchase/modal_raw_material.load') }}
</div>
</div>
</div>
</div>

*- jquery.form.js* : same result like before the submit button only show 
working... (no error traceback occured, but the result is not expected)
*code*
views/transaction_purchase/purchase_order_form.html
{{=form}}

<script 
src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js";></script> 
<script src="http://malsup.github.com/jquery.form.js";></script> 

<script>
function load_in_modal(url, modal_id, options) {
    if (typeof options === 'undefined') {
      /* Example Options.
       * {title: "Add Image", upload_form: true}
       */
      options = {};
    }

    /*
     * You can remove this if you don't want to deal with file uploads.
     * If you want to use this, the view/controller using this should
     * insert jquery.form.js on response.files.
     */
    if (Boolean(options.upload_form)) {
        $.web2py.trap_form = function (action, target) {
          /* traps any LOADed form */
          $('#' + target + ' form').each(function (i) {
            var form = $(this);
            if (form.hasClass('no_trap')) {
              return;
            }

            form.attr('data-w2p_target', target);
            var url = form.attr('action');

            if ((url === "") || (url === "#")) {
              /* form has no action. Use component url. */
              url = action;
            }

            if(form.find('.input-file').length>0) {
                form.ajaxForm({
                    url: action,
                    success: function(data, statusText, xhr) {
                        jQuery('#'+target).html(xhr.responseText);
                        $.web2py.trap_form(action,target);
                        $.web2py.ajax_init();
                    }
                });
            }
            else {
                form.submit(function (e) {
                  
$.web2py.disableElement(form.find($.web2py.formInputClickSelector));
                  $.web2py.hide_flash();
                  $.web2py.ajax_page('post', url, form.serialize(), target, 
form);
                  e.preventDefault();
                });
            }
          });
        };
    }
    /* end of file upload dealing code */


    /* Remember to set an id in your modal's body */
    $.web2py.component(url, $('#' + modal_id + ' .modal-body').attr('id'));

    $('#' + modal_id).modal({show: true});
    if (typeof options.title !== undefined) {
        $('#' + modal_id + ' .modal-title').text(options.title);
    }
}
</script> 

<!-- modal raw_material -->
<div class="modal fade" id="modal_raw_material" 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"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title" id="myModalLabel">{{=DIV(T('Raw Material') ) }}</h4>
</div>
<div class="modal-body">
{{=LOAD('transaction_purchase', 'modal_raw_material.load', ajax = True) }}
</div>
</div>
</div>
</div>

any idea how to do it in web2py app?

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