Mensaje
 
a
Todos
General information
Foro:
Javascript
Category:
Título:
Simple way to treat 0 as wrong value?
Miscellaneous
ID de la conversación:
01641904
ID del mensaje:
01641904
Views:
38
Hi everybody,

I have the following drop down
<select class="form-control-inline"
                        ng-model="currentMatrixTemplate.rowAttributeId"
                        required
                        ng-change="changeAttribute('row', currentMatrixTemplate.rowAttributeId, {{currentMatrixTemplate.rowAttributeId}})"
                        ng-options="attribute.value as attribute.text for attribute in metaData.attributes |filter: { value: '!' + currentMatrixTemplate.columnAttributeId }">
                    <option value="" disabled>        @String.Format(Labels.selectX, Labels.attribute)...</option>
                </select>
I want to make sure that user selected a value which will be a number greater than 0. I don't want the Add button to become enabled until it's done.

I can, of course, make all the necessary checks in the Add button's code, but wondering if it somehow possible to treat 0 as 'empty' for required?


Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Responder
Mapa
Ver