Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

When I use input type as number with value attribute it didn't shows the value it the input box. But, when I change it to text it works correctly.

<input value="30" ng-model="project.camp_duration" min="30" max="60" id="camp_duration" name="camp_duration" type="text" placeholder="Days" class="form-control input-md" required="" autocomplete="off">

<input value="30" ng-model="project.camp_duration" min="30" max="60" id="camp_duration" name="camp_duration" type="number" placeholder="Days" class="form-control input-md" required="" autocomplete="off">

Above, the first one fills the text box with a value which is given.

Am I missing something or is this a bug.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

An input with type number has to be an integer.

I think your project.camp_duration is a String.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.