Commit dee1f7479d0e7ddfa3fb33a342a39b4f28d7f13a
1 parent
7cdbd289e4
Exists in
master
and in
1 other branch
validation use
Showing
2 changed files
with
24 additions
and
11 deletions
Show diff stats
pages/registration.html
... | ... | @@ -26,17 +26,9 @@ |
26 | 26 | <div class="icon-circle-d"> |
27 | 27 | <i class="material-icons" style="line-height: 30px;">email</i> |
28 | 28 | </div> |
29 | - <input type="email" name="email" ng-pattern="/^[^\s@]+@[^\s@]+\.[^\s@]+$/" class="text-input" required class="" ng-model="data.email" placeholder="Email Address *" ng-change="enteremail(data.email); emailkeyPress(data.email)"> | |
30 | - <!-- <label class="error-message f-family" id="invalidEmail">Please enter a valid email address.</label> | |
31 | - <label ng-if="check">Email already exist.</label> --> | |
32 | - </div> | |
33 | - <div class="col-xs-12 col-md-6 input-wrapper" > | |
34 | - <div class="icon-circle-e"> | |
35 | - <i class="material-icons" style="line-height: 30px;">phone</i> | |
36 | - </div> | |
37 | - <input type="text" ng-pattern="/^\d*(?:\.\d{1,2})?$/" title="Please enter only numberic numbers" maxlength="10" required class="text-input" ng-model="data.number" placeholder="Mobile No.*" ng-change="enternumber(data.number); phonekeyPress(data.number)"> | |
38 | - <!-- <label class="error-message f-family" id="invalidNumber">Please enter only numeric value in mobile number field.</label> --> | |
39 | - <label ng-if="numberCheck">Contact Number already exist.</label> | |
29 | + <input type="email" name="email" ng-pattern="/^[^\s@]+@[^\s@]+\.[^\s@]+$/" class="text-input" required class="" ng-model="data.email" ng-blur="emailcheck(data.email)" ng-focus="removeError()" placeholder="Email Address *" ng-change="enteremail(data.email); emailkeyPress(data.email)"> | |
30 | + <label class="error-message f-family" id="invalidEmail">Please enter a valid email address.</label> | |
31 | + <!-- <label ng-if="check">Email already exist.</label> --> | |
40 | 32 | </div> |
41 | 33 | <div class="col-xs-12 col-md-6 input-wrapper"> |
42 | 34 | <div class="icon-circle-f"> |
... | ... | @@ -55,6 +47,14 @@ |
55 | 47 | <option value="Mumbai">Mumbai</option> |
56 | 48 | </select> |
57 | 49 | </div> |
50 | + <div class="col-xs-12 col-md-6 input-wrapper" > | |
51 | + <div class="icon-circle-e"> | |
52 | + <i class="material-icons" style="line-height: 30px;">phone</i> | |
53 | + </div> | |
54 | + <input type="phone" name="phone" ng-pattern="/^\d*(?:\.\d{1,2})?$/" maxlength="10" class="text-input" required class="" ng-model="data.number" ng-blur="numbercheck(data.number)" ng-focus="removeNoError()" placeholder="Mobile No.*" ng-change="enternumber(data.number); phonekeyPress(data.number)"> | |
55 | + <label class="error-message f-family" id="invalidNumber">Please enter only numeric value.</label> | |
56 | + <!-- <label ng-if="numberCheck">Contact Number already exist.</label> --> | |
57 | + </div> | |
58 | 58 | <div class="col-xs-12 col-md-6 input-wrapper"> |
59 | 59 | <div class="icon-circle-i"> |
60 | 60 | <i class="material-icons" style="line-height: 30px;">perm_identity</i> | ... | ... |
script.js
... | ... | @@ -325,6 +325,19 @@ |
325 | 325 | } |
326 | 326 | }; |
327 | 327 | |
328 | + $scope.removeNoError = function() { | |
329 | + $('#invalidNumber').css('display', 'none'); | |
330 | + $('#alreadyExist').css('display', 'none'); | |
331 | + }; | |
332 | + | |
333 | + $scope.numbercheck = function(val) { | |
334 | + if (val == undefined) { | |
335 | + $('#invalidNumber').css('display', 'block'); | |
336 | + } else { | |
337 | + $('#alreadyExist').css('display', 'block'); | |
338 | + } | |
339 | + }; | |
340 | + | |
328 | 341 | // $scope.$on('city', function (event, value) { |
329 | 342 | $scope.data.city = localStorage.getItem("city"); |
330 | 343 | console.log("HERE===",$scope.data.city ); | ... | ... |