N
N
nepster-web2015-01-06 21:12:37
JavaScript
nepster-web, 2015-01-06 21:12:37

Yii2 how to get response from server in js using Active Form?

I have a form with this configuration:

{% set form = active_form_begin({
            'options' : {
                'id' : 'form-create-market',
                'class' : 'form-horizontal',
            },
            'enableAjaxValidation' : true,
            'enableClientValidation' : false,
        }) %}
...    
        <div class="form-group text-center">
            <input type="submit" name="button" id="button-create-market" value="{{ t('markets.main', 'CREATE_MARKET') }}" class="btn btn-primary" />
        </div>
        {{ active_form_end() }}


When the user sends data to the server, validation occurs, everything is OK. But when the validation is passed and I do certain actions, the server should give the answer that I want to get in the js code.

How can I do that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
raycheel, 2015-01-07
@raycheel

But when the validation is passed and I do certain actions, the server should give the answer that I want to get in the js code.

I want to answer, but I do not understand the problem. Write specifically what you want, what does it mean to "receive in js code" - the response from the server?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question