Click here to Skip to main content
14,937,268 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This ismy html code :

<div class="form-group col-md-3">
                   <span>No. of Positions *</span>
                   <input type="number" min="1"id="vacancies" class="form-control" name="position" placeholder="9" data-ng-model="Job.Position" required >
                   <span ng-show="(formaddjob.position.$dirty || submitted) && (formaddjob.position.$error.required || !formaddjob.position.$valid)">
                       <span class="error" ng-show="formaddjob.position.$error.required">
                           Vacancies Required!
                       <span class="error" ng-show="formaddjob.position.$error.number || !formaddjob.position.$valid">
                           Not valid number!

Please give me help

1 solution

Hey there,

there is a good example in the angularjs documentation about the input field (link).

I copied a very simple example and it worked out of the box:

    <body ng-app>
        <form name="myForm">
            User name:
            <input type="text" name="userName" data-ng-model="" required>
        <div role="alert">
            <span class="error" ng-show="myForm.userName.$error.required">

Please let me know, if this helps.

P.S.: Formatting your code helps ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900