Created
July 17, 2017 12:02
-
-
Save kmarenov/8aed0bee5a65514b6dbb6c72ab4c5ef0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document.body).on('submit', 'form.valuation-request-form', function (event) { | |
| event.preventDefault(); | |
| var title = 'Заявка принята'; | |
| var message = 'Мы свяжемся с вами в ближайшее время'; | |
| var modal = $('#md-after-subscribe'); | |
| var form = $(this); | |
| $.ajax({ | |
| type: 'POST', | |
| url: Routing.generate('api_app_form_valuation_request'), | |
| data: new FormData(form[0]), | |
| processData: false, | |
| contentType: false | |
| }) | |
| .done(function (data) { | |
| if (data.errors) { | |
| title = 'Ошибка'; | |
| message = data.errors; | |
| } else { | |
| $('form.valuation-request-form input[type="text"]').val(''); | |
| $('form.valuation-request-form textarea').val(''); | |
| $('#files').html(''); | |
| } | |
| modal.find('h2').text(title); | |
| modal.find('p').text(message); | |
| hidePopup(); | |
| modal.fadeIn(); | |
| $('body').addClass('popup-shows'); | |
| $('.custom-scroll').jScrollPane(); | |
| modal.find('.custom-scroll').jScrollPane(); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment