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:
Hi
This ismy html code :

HTML
<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>
                       <span class="error" ng-show="formaddjob.position.$error.number || !formaddjob.position.$valid">
                           Not valid number!
                       </span>
                   </span>
               </div>


Please give me help
Posted

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:

HTML
<html>
    <head>
        <script
             src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.9/angular.min.js">
        </script>
    </head>
    <body ng-app>
        <form name="myForm">
        <label>
            User name:
            <input type="text" name="userName" data-ng-model="user.name" required>
        </label>
        <div role="alert">
            <span class="error" ng-show="myForm.userName.$error.required">
                Required!
            </span>
        </div>
    </form>
    </body>
</html>


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