onsubmit refresh html form

前端 未结 5 731
春和景丽
春和景丽 2021-01-12 00:54

I\'m trying to use Javascript to submit the form\'s data. Here\'s the html.

//input fields here
5条回答
  •  佛祖请我去吃肉
    2021-01-12 00:57

    Since you added the jQuery tag, this it the best way to do this:
    unobtrusive event attach

    $('form').submit(function(){
            alert('the form was submitted');
            return false;
        });
    

    In your's way it should be;

提交回复
热议问题