1
I have a modal where I need to force the user to select a combo option and also enter a value in the input field. I used the ng-required directive and to display the error message but still it is not forcing, Any idea:
Thanks in advance.
// **** combo html ******
<div class="modal-body">{{'application.outbound.outboundBatchControl.wantToSeparation'| translate}}</div>
<div class="form-group">
<select ng-model="selectedLabelType"
style="width: 500px"
name="labelType"
id="labelType"
class="form-control"
ng-options="labelType as labelType.label for labelType in labelType track by labelType.id"
placeholder="{{'application.msg.labelSelect.labelType' | translate}}"
ng-required="true">
<span ng-class="error" ng-show="modalReprint.$error.required">Campo Combo é obrigatorio</span>
<option value="" >{{'application.msg.labelSelect.labelType' | translate}}</option>
</select>
</div>
// ********** input html ***********
<div class="form-group">
<label for="LabelTo" class="control-label" translate>Label To</label>
<input ng-model="inputPriorityTo"
style="width: 500px"
id="priorityTo"
name="priorityTo"
type="text"
class="form-control fontSizeItemReceiving"
maxlength="20"
ng-required="controller.isRequired"/>
<span ng-class="error" ng-show="modalReprint.$error.required">Campo From é obrigatorio</span>
</div>
How so he is not forcing ??
– LeAndrade
Opa Leandrade thanks for the return, if you do not select any option or do not insert any data in the input and press the button to follow the next process it will. My idea is to display some msg preventing the process to proceed if an option was not selected in the combo or enter a value in the input.
– Pereira