How to validate inputs inside form and submit button outside the form
<p>Based on requirement I am trying to validate the form.</p>

<p>Actually I am passing form input elements in bootbox modal dialog and passing submit button dynamically in modal dialog.</p>

<p>When input type=submit is there it is able to validate form inputs.But is there is no submit button inside form as i am passing it in modal, it is not able to validate form.
For example:</p>

<pre><code>&lt;form id="form_id"&gt;
Name:&lt;input type="text" required&gt;
&lt;input type="submit" value="Submit"&gt;
&lt;/form&gt;

$("#form_id").submit(function(e)){
//validation is ok
return false;
}
</code></pre>

<p>this is ok but,
now in modal:</p>

<pre><code>    var data="&lt;form id="form_id"&gt;
    Name:&lt;input type="text" required&gt;
    &lt;/form&gt;"; //getting from server

            $.ajax({
            url : 'url',
            type : 'get',
            async : true,
            data : data,
            success : function(data) {
                modalDialog = bootbox.dialog({
                    size : 'large',
                    title : "Title"
                    show : false,
                    message : data,
                    buttons : {
                        success: {
                            label : "Close window",
                            className : "btn-default",
                            callback : function() {
  return false;
        //after clicking submit button it should ask required if no data input,and stay in dialog as what happened previous scenario.But dialog is closed.

                            }
                        }
                    }
                });
                modalDialog.on('shown.bs.modal', function() {
                });

                modalDialog.modal('show');

            }

        });
</code></pre>