I am trying to populate an html field with some text being queried using jQuery Ajax. The data being sent to the function view is received back on page load. The callback data can be seen in the console. However the data value itself is not populated in the input field.
Why my code below is failing:
$('.clsSomeTxt input').val(data.recdValue);
Whereas in the console it shows:
console.log('The value received back is: ' + data.recdValue);
I have tried using form's id also, without success.
Edit
<table id="xHeader">
{% for fieldX in form.visible_fields %}
<tr>
<th>{{ fieldX.label_tag }}</th>
<td>
{{ fieldX.errors }}
{% if fieldX.name == "model_id" %}
{{ fieldX }}<input type="text" class="clsSomeTxt" id="clsSomeTxt" readonly style="background: lightgrey; width: 320px">
{% else %}
{{ fieldX }}
{% endif %}
</td>
</tr>
{% endfor %}
</table>
htmltoo, guess your class or your selector is wrong