Commit 248bd9b7cea7d7262bc6a1eb3472f7cf44f1c022
1 parent
70b1fd33b4
Exists in
master
and in
1 other branch
link validation
Showing
3 changed files
with
30 additions
and
26 deletions
Show diff stats
css/custom.css
... | ... | @@ -221,11 +221,18 @@ |
221 | 221 | .textarea{ |
222 | 222 | min-height: 97px; |
223 | 223 | } |
224 | -.error-message{ | |
224 | +/*.error-message{ | |
225 | 225 | font-weight: inherit; |
226 | 226 | color: #ff0000; |
227 | 227 | margin: 5px 4px -5px 0px; |
228 | 228 | display: none; |
229 | +}*/ | |
230 | + | |
231 | +.error-message{ | |
232 | + font-weight: inherit; | |
233 | + color: #ff0000; | |
234 | + margin: 7px 4px -5px 26px; | |
235 | + display: none; | |
229 | 236 | } |
230 | 237 | |
231 | 238 | /*custom input*/ | ... | ... |
pages/ambassador.html
... | ... | @@ -155,8 +155,8 @@ |
155 | 155 | <div class="icon-circle-h"> |
156 | 156 | <i class="material-icons" style="line-height: 30px;">web</i> |
157 | 157 | </div> |
158 | - <input name="link" class="text-input" ng-model="data.link" placeholder="link" ng-change="enterbusiness(data.link); linkedInkeyPress(data.link)" required> | |
159 | - </input> | |
158 | + <input name="link" class="text-input" ng-pattern="/^(http[s]?:\/\/){0,1}(www\.){0,1}[a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,5}[\.]{0,1}/" ng-blur="emailcheck(data.link)" ng-focus="removeError()" ng-model="data.link" placeholder="link" ng-change="enterbusiness(data.link); linkedInkeyPress(data.link)" required> | |
159 | + <label class="error-message f-family" id="invalidEmail">Please enter a valid link.</label> | |
160 | 160 | </div> |
161 | 161 | <div class="col-xs-12 col-md-12 f-family line-adjust"> |
162 | 162 | <strong>Coupon Code.</strong> | ... | ... |
script.js
... | ... | @@ -1173,33 +1173,30 @@ |
1173 | 1173 | /*open videos ends here*/ |
1174 | 1174 | |
1175 | 1175 | $scope.removeError = function() { |
1176 | - console.log("doooo") | |
1177 | 1176 | $('#invalidEmail').css('display', 'none'); |
1178 | 1177 | $('#alreadyExist').css('display', 'none'); |
1179 | 1178 | }; |
1180 | 1179 | |
1181 | - // $scope.emailcheck = function(val) { | |
1182 | - // consol.log("kdsbd") | |
1183 | - // $scope.space = /\s/g.test(val); | |
1184 | - // console.log("space",$scope.space) | |
1185 | - // if (val == undefined) { | |
1186 | - // $('#invalidEmail').css('display', 'block'); | |
1187 | - // } else { | |
1188 | - // $http({ | |
1189 | - // method: 'GET', | |
1190 | - // url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', | |
1191 | - // headers: {} | |
1192 | - // }).then(function mySuccess(searchResult) { | |
1193 | - // console.log("searchResult1===>", searchResult) | |
1194 | - // if (searchResult.data.length == 0) { | |
1195 | - // $scope.check = false; | |
1196 | - // } else { | |
1197 | - // $scope.check = true; | |
1198 | - // $('#alreadyExist').css('display', 'block'); | |
1199 | - // } | |
1200 | - // }, function myError(error) {}); | |
1201 | - // } | |
1202 | - // }; | |
1180 | + $scope.emailcheck = function(val) { | |
1181 | + if (val == undefined) { | |
1182 | + $('#invalidEmail').css('display', 'block'); | |
1183 | + } else { | |
1184 | + $('#alreadyExist').css('display', 'block'); | |
1185 | + // $http({ | |
1186 | + // method: 'GET', | |
1187 | + // url: BASE_URL + '/ambassadors?filter={"where": {"email": {"like":"%25' + $scope.data.email + '%25"}}}', | |
1188 | + // headers: {} | |
1189 | + // }).then(function mySuccess(searchResult) { | |
1190 | + // console.log("searchResult1===>", searchResult) | |
1191 | + // if (searchResult.data.length == 0) { | |
1192 | + // $scope.check = false; | |
1193 | + // } else { | |
1194 | + // $scope.check = true; | |
1195 | + // $('#alreadyExist').css('display', 'block'); | |
1196 | + // } | |
1197 | + // }, function myError(error) {}); | |
1198 | + } | |
1199 | + }; | |
1203 | 1200 | |
1204 | 1201 | // $scope.removeNoError = function() { |
1205 | 1202 | // $('#invalidNumber').css('display', 'none'); | ... | ... |