O
O
osmolka2016-11-29 17:48:34
Yii
osmolka, 2016-11-29 17:48:34

Can modals conflict with each other?

Three widgets are connected on one page: a modal window with a callback (action site/callback), a form with a questionnaire (action site/anketa) and a modal window with reviews (action review/add). connected in the same order.
In each, approximately the same code (variable names differ)

<?php echo BsHtml::ajaxSubmitButton(Yii::t('app','Отправить'), $this->createUrl('site/anketa'), array(
                'dataType'=>'json',
                'type'=>'POST',
                'success'=>'function(data)
                            {
                                if(data.status=="success")
                                {
                                    $("#modalAnketa").modal("show");
                                    $("#anketa-form")[0].reset();

                                    $(".captcha img").attr({"src": "/review/captcha/refresh/?"+Math.floor(Math.random()*(98)) + 1});
                                    $(".images .thumbnails li").remove();
                                }
                                else
                                {
                                    $.each(data, function(key, val)
                                    {
                                        $("#anketa-form").find("#"+key+"_em_").text(val).show();
                                    });
                                    $(".captcha img:first").trigger("click");
                                }
                            }',
            ),

But only the questionnaire works adequately, sends data to its action, the callback opens its own modal window, but the data is sent to site / anketa, and reviews - the modal window does not open at all, but in the console it shows that it also refers to site / action.
What is the possible error, why is everything sent to site/action?
PS sorry for the confusion of thoughts, newbie in php.

UPD The issue is resolved, the problem is in the same id of the buttons, I used them for styles and forgot to change them.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2016-11-29
@R0dger

Look at the windows id .. maybe it's there ... as an option to connect it manually ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question