This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

jlongo
jlongo

I have the following code on a page:

PHP code section

function onSelecaoGE(){
$this['temp'] = post('selecaoge');
}

and on page html

<div class="col ptxt1">

<select class="form-control"
        name="selecaoge"
        data-request="onSelecaoGE"
        data-request-update="_foe_rec_nivel: '#selnivel'"
        id="escolhage">
    <option disabled selected> -- Escolha um Grande Edifício --</option>
    {% for ge in ge_all %}
    {% if ge.era_id == 0 %}
    {% set conta = ge.recompensa_ge_conta2[0].count %}
    {% else %}
    {% set conta = ge.recompensa_ge_conta[0].count %}
    {% endif %}
    <option value="{{ ge.id }}">{{ ge.nome }} ({{ conta }})</option>
    {% endfor %}
</select>

</div>
<div class="col ptxt1" id="selnivel">
{% partial "_foe_rec_nivel" %}
</div>

and on partial just have

  {{ temp }}

also i have jquery loaded and {% framework extras%} in layout file.

Everything looks good as per documentation and some examples i found.

But when i make any selection on the select it starts the ajax call, but it never ends.

After several changes i can't figure out what is wrong. Any help will be appreciated.

TIA

JL

jlongo
jlongo

With the help of "alxy" on Slack we found that the problem is related with the version of jquery loaded. I'm loading jquery-3.3.1.slim.min.js that appears to not have complete ajax support. I changed to load the regular version jquery-3.3.1.min.js and is working perfectly.

JL

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.