D
D
Denis2019-06-13 21:22:12
AJAX
Denis, 2019-06-13 21:22:12

Ajax contact form script not working?

There is a ready-made feedback form , I downloaded it from here , uploaded it for the test, everything works, I transfer it to Bitrix, it doesn’t work, as I understand it, because of the wrong paths. He is painfully cunning, this Bitrix. If anyone understands, please tell me. If my submission form is located in Bitrix at /local/templates/main/footer.php , then if you look at how the demo script works, you need to put the feedback folder with all the insides at /local/templates/main/feedback.... and in the feedback.js file, add the url path like this...

function myconf() {
    var cf = $.Deferred();
        $.ajax({
            type: 'POST',
            url: 'feedback/',
            dataType: 'json',
            data: 'act=cfg',
            success: function(answer) {
                cf.resolve(answer.configs);
            }
        });
    return cf;
}

do you have to...?
function myconf() {
    var cf = $.Deferred();
        $.ajax({
            type: 'POST',
            url: 'local/templates/main/feedback/feedback/',
            dataType: 'json',
            data: 'act=cfg',
            success: function(answer) {
                cf.resolve(answer.configs);
            }
        });
    return cf;
}

but it doesn't work....
the scripts are all connected, jquery too, the console is silent, so I think that this is something wrong with the paths. On the form, I press the submit button, nothing happens ... so there should at least be errors, as in the demo, but this is if everything is written correctly. But again, everything works on the test ... but Bitrix is ​​​​so confused .... and does not work .. if anyone understands what's the matter, tell me ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex-1917, 2019-06-13
@alex-1917

you download not

from here
, but from any of the 295 chewed answers on a topic that is of vital importance to you, and these answers are on the official Bitrix forum.
And then from this I have been yelling for an hour now:
transferring to Bitrix does not work, as I understand it because of the wrong paths. He is painfully cunning, this Bitrix

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question