Jump to content

How to use browser default validation when using JS


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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...