0

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.

1 Answer 1

1

An input with type number has to be an integer.

I think your project.camp_duration is a String.

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

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.