Is there an “after submit” jQuery option?

后端 未结 4 585
执笔经年
执笔经年 2020-12-03 02:31

I have a form that uploads a file and targets an iframe on the page. When the user clicks submit, I want the file contents to \"clear\" out.

I tried this

<         


        
4条回答
  •  不思量自难忘°
    2020-12-03 03:04

    If you have no other handlers bound, you could do something like this:

    $('#imageaddform').submit(function(e) {
        e.preventDefault(); // don't submit multiple times
        this.submit(); // use the native submit method of the form element
        $('#imagefile').val(''); // blank the input
    });
    

提交回复
热议问题