ajax form validation with mysqli_query

前端 未结 2 1938
眼角桃花
眼角桃花 2021-01-21 02:34

so far I have used pure javascript to validate my form, but I need to add a mysqli query into the mix. Only I\'m not so great with jquery and ajax. I can do a simple login form

2条回答
  •  半阙折子戏
    2021-01-21 02:51

    Take a look at the Ajax Form Plugin http://malsup.com/jquery/form/.

    For example, use it like this:

    $(document).ready(function() { 
        $('#myForm').ajaxForm(
        {
            beforeSend: function() {
    
            },
            success: function(response)
            {
                    //wow, it worked, let's do something with response
            },
            uploadProgress: function(event, position, total, percentComplete) {
                /*e.g. a upload percentage label */ 
                //var percentVal = percentComplete + '%';
                //$('#myLoadingDiv').html(percentVal);
            },
            cache: false,
        });
    });
    

提交回复
热议问题