0

I have this select which i need the default value to be empty, tried adding a option with value="?" and selected="selected" but it wont work, any ideas?

<select class="form-control" 
        id="Select7" 
        name="grossweightmeasurementunitcode" 
        ng-model="itemForm.grossweightmeasurementunitcode" 
        ng-required="true">
        <option ng-repeat="unidadepeso in unidadespeso" value="{{unidadepeso.commoncode}}">{{unidadepeso.sigla}}</option>
 </select>
F.Almeida
  • 413
  • 2
  • 12
  • i think angularjs provides a blank value by default. refer to this post: https://stackoverflow.com/questions/12654631/why-does-angularjs-include-an-empty-option-in-select – CodeHunter Feb 19 '18 at 17:47

1 Answers1

0

try this:

<select 
                        class="form-control" 
                        id="Select7" 
                        name="grossweightmeasurementunitcode" 
                        ng-model="itemForm.grossweightmeasurementunitcode" 
                        ng-required="true">
<option value="">--Select--</opton>
                            <option ng-repeat="unidadepeso in unidadespeso" value="{{unidadepeso.commoncode}}">{{unidadepeso.sigla}}</option>
                    </select>
Rani Radcliff
  • 4,856
  • 5
  • 33
  • 60