1

i am creating a web app and i have a dropdownlist

<select id="drdsearch" ng-model="drd" style="margin-top:-39px; margin-left:300px; height:30px; width:200px; font-size:12px;"><option value="select">select</option>
        <option value="default">Default</option>
        <option value="venue">Venue Name</option>
        <option value="date">Date</option>
    </select>

with these textboxes

 <input type="text" ng-hide="true" ng-show="drd=='default'" placeholder="d" name="default">
    <input type="text" ng-hide="true" ng-show="drd=='venue'" placeholder="e" name="venue name">
    <input type="text" ng-hide="true" ng-show="drd=='date'" placeholder="l" name="Date">

i used angularjs for (hide/show)textboxes but now when i run my program dropdown automatically included an extra blank option field

now there are four fields in my dropdow 1st ( )blank

2nd default

3rdvenue

4thDate

what i need to do to remove the extra (blank option) from the dropdownlist

1 Answer 1

0

Initialize the value in your $scope.drd with 'default' and you should be fine.

Sign up to request clarification or add additional context in comments.

2 Comments

Sir where i need to initialize the value?
Either in the controller using the $scope variable or you could try ng-init="drd='default'".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.