Jquery function BEFORE form submission

后端 未结 7 2202
一整个雨季
一整个雨季 2020-12-13 08:25

I am trying to fire a function using Jquery when the form submit button is clicked, but the function needs to fire BEFORE the form is actually submitted.

I am trying

7条回答
  •  情深已故
    2020-12-13 08:58

    Aghhh... i was missing some code when i first tried the .submit function.....

    This works:

    $('#create-card-process.design').submit(function() {
        var textStyleCSS = $("#cover-text").attr('style');
        var textbackgroundCSS = $("#cover-text-wrapper").attr('style');
        $("#cover_text_css").val(textStyleCSS);
        $("#cover_text_background_css").val(textbackgroundCSS);
    });
    

    Thanks for all the comments.

提交回复
热议问题