maccesch / cmsplugin-contact

Extendable contact plugin for django-cms with spam protection and i18n
BSD 2-Clause "Simplified" License
71 stars 62 forks source link

Ajax form ;) #89

Closed Darex1991 closed 6 years ago

Darex1991 commented 7 years ago

Hi guys, I have two simple (or not) questions :) 1) How to use ajax on this plugin. I tried to use action for '/' but it returns me whole website without errors. 2) And second: What path and with what key data I should send?

$.ajax({
        url : "/", 
        type : "POST",
        data : { SOME_KEY_?? : $('#contact-form').val() },

        success : function(json) {
            console.log(json);
            console.log("success");
        },

        // handle a non-successful response
        error : function(xhr,errmsg,err) {
            console.log(xhr.status + ": " + xhr.responseText); 
        }
    });

@maccesch @mitar @rfleschenberg @daanzap