Jump to content

How to use browser default validation when using JS


Muiter
 Share

Recommended Posts

Any suggestions please ow to change the code below because I would like yo use the standard browser validation.

Quote

<script type="text/javascript">
$(document).ready(function () {
    $(".edit_table_1").on('click', function() {
        formid=($(this).attr("alt"));
        subform_edit_table_1(formid);
    });
});
function subform_edit_table_1(formid)
{
       var postData = $("#edit_table_1"+formid).serializeArray();
       var formURL='includes/adres_edit_proces.php';
        $.ajax({
            url: formURL,
            type: "POST",
            data: postData,
            success: function(data, textStatus, jqXHR) {
                $('#modal_edit_table_1'+formid+' .modal-body').html(data);
                $("#submit_edit_table_1"+formid).remove();
                $("#submit_edit_table_1_2nd"+formid).remove();
            },
            error: function(jqXHR, status, error) {
                console.log(status + ": " + error);
            }
        });
        e.preventDefault();
}
</script>

 

Quote

<button type="button" class="btn btn-info edit_table_1" id="submit_edit_table_1'.$i.'" alt="'.$i.'">Bewerk</button>

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...