Hi.
This is my code:
$('#holidaySummary_clientID').val(response[0].name).trigger('change');
$('#holidaySummary_clientID').prop("readonly", true);
under ‘success’ Ajax callback function.
When these statements are executed, the following occurs:
1 the mentioned select set a blank value.
2 the response[0].name isn’t being setted as a value for this select.
3 the mentioned select DOESN’T set to readonly.
The view:
<div class="col-md-4" style="padding-left: 15px;padding-right: 15px">
<div class="form-group form-group-material">
<label class="control-label is-visible">
{{ form_label(form.clientID, 'Proposal Client', {'label_attr': {'class': 'control-label is-visible'}}) }} *
</label>
{{ form_widget(form.clientID, { 'attr' : {'class' : 'select2 form-control', 'placeholder' : 'Proposal Client'} }) }}
</div>
</div>
What’s wrong?