Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function () {
- let registerForm = "{{ path('site_devenir_vip_ajax_payment_form') }}";
- $("#spinner")
- .hide();
- $("#userPaymentForm")
- .submit(function (e) {
- e.preventDefault();
- $.ajax({
- url: registerForm,
- type: "POST",
- dataType: "json",
- data: $(this)
- .serialize(),
- beforeSend: function () {
- $("#spinner")
- .show();
- },
- success: function (data, textStatus, xhr) {
- if (xhr.status === 200 && textStatus === "success") {
- console.log(data.template);
- $("#userForm")
- .html(data.template);
- console.log("here 1");
- $("#paymentForm")
- .submit();
- console.log("here 2");
- } else {
- console.log(data);
- }
- },
- complete: function () {
- $("#spinner")
- .hide();
- },
- error: function (jqXHR, status, error) {
- },
- });
- });
- $("#paymentForm")
- .submit(function (e) {
- e.preventDefault();
- console.log('iciiii')
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement