Q:

How to use Bootstrap required field on type "button" instead of submit?

This is my code :
    <form>   
            <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-envelope fa-10x"></i></span>
                <input type="email" class="form-control" id="exampleInputEmail1" placeholder="Email" required="required">     
            </div>
        <br/>
            <div class="input-group">
                <span class="input-group-addon"><i class="fa fa-key fa-10x"></i></span>
                <input type="password" class="form-control" id="exampleInputPassword1" placeholder="Password" required="required">    
            </div> 
        <br/>
        <button type="button" class="btn btn-default">Submit</button>
    </form>

required="required" is working if I change button type = "submit", but I want to use button type = "button" only, as I want to submit the form using AJAX. How do I use required field using button type = "button" ?

A:

Why don't you try to use standard type button "submit" and assign to event of the form "submit" handler, where first call event.preventDefault(), to prevent form sending, and then call AJAX.

