Search Posts

Category: forms

TypeError: Cannot read property ‘value’ of null in angular js

I am using google recaptcha before a form submit in my angular js application and it is working fine for the first time but if i try to submit the form second time(same form) it is showing the error angular.js:14525 TypeError: Cannot read property ‘value’ of null My recaptcha code is <div vc-recaptcha key=”my key here” ng-model=”letter.myRecaptchaResponse” on-create=”setRecaptchaId(widgetId)”> </div> My controller code is $scope.setRecaptchaId = function(widgetId) { $scope.recaptchaId = widgetId; return; }; $scope.letter.mresponse = vcRecaptchaService.getResponse($scope.recaptchaId); […]

Dynamic form using AngularJS, multiple values binding

I am looking for a best approach to convert a static form to an angular dynamic form. I am not sure how to bind multiple values to the same answer. The static page is available at: https://jsfiddle.net/hvuq5h46/ <div ng-repeat=”i in items”> <select ng-model=”i.answer” ng-options=”o.id as o.title for o in i.answersAvailable” ng-visible=”y.TYPE = ‘SINGLE'”></select> <input type=”checkbox” ng-model=”i.answer” ng-visible=”y.TYPE = ‘MULTIPLE'” /> </div> The JSON file [ { “id”: 1, “title”: “Are you a student?”, “type”: “SINGLE”, […]

After adding tags-input tag remaining form fields are disabled

In my angularjs application i added ngTagsInput directive for tags-input field but after adding this field at end of all form fields it is working and remaining fields are disabled and not working, then i changed it’s location from last to top of all other form fields now remaining form fields are working. I didn’t understand this behavior. My requirement is tags-input field must be at end of all fields. Source: AngularJS

AngularJS – dynamic validation using $valid

I’m using AngularJS to validate a form, and I have this button to submit. <button type=”submit” ng-disabled=”btn” ng-click=”submit(settings.$valid)” class=”btn btn-primary”> Submit </button> This button is disabled whenever the form is invalid, but once it’s valid, the button is enabled. So this is my code $http.get(“http://localhost:5000/settings”).then(function(response){ $scope.numberOfRows = response.data.numberOfRows console.log($scope.numberOfRows) if($scope.numberOfRows==0 && $scope.settings.$valid == false ){ $scope.btn=true }else if($scope.numberOfRows==0 && $scope.settings.$valid == true){ $scope.btn=false } if($scope.numberOfRows==1){ $scope.btn=true } }) My problem is when the numberOfRows = […]