[Fixed]-Django/Python: How to submit form once div is clicked using AJAX?

1👍

Well, here’s an example as to how I would normally use ajax to make a request (incorporating your code). Might not be exactly what you need, but should point you in the right direction…

$('.up-arrow').click(function(){
    $(this).hide()
    $('.up-arrow-form').submit(function(){

        $.ajax({
            url: 'http://someurl.com/voteuppost',
            type: 'GET'
            data: $(this).serialize(),
            success: function(data) {
                // do something on success
            },
            error: function(err) {
                console.log('err: ' + err);
            }
        });

    });
});

Leave a comment