Search Posts

Category: forms

Check validity of ng-form with a dynamic name – Angular JS 1.2.25

I have several components that are wrapped in an ng-form tag, and within this component I have a custom two-way binding defining the form’s name, as below. How can I check the validity of formStepName when it already needs to be interpolated? Or am I approaching this wrong? Example below Form Component angular.module(‘formModule’) .directive(‘formStep’, [ function() { return { restrict: ‘E’, templateUrl: ‘/partials/form-components/form-step.component.html’, require: [ ‘^form’ ], scope: { formStepConfig: ‘=’, formStepName: ‘@’, formReference:’=’, ngModel: […]

Filling a website’s login fields on AngularJS form using WKWebView’s Javascript

I am using WKWebView controller and I need to fill in email and password fields with data. I’ve already been using the “evaluate javascript” method to fill in the form’s values, but submitting a form this way only works on simpler ones. The AngularJS forms will say this even when the value is filled: After entering one letter then deleting it in each field, I can submit. I know that it’s probably an “onChange” event, […]

How to keep form error message blank on initial load in AngularJS

I’m trying to learn forms in AngularJS 1.x. But I have error messages that are always on when it first loads. How to develop behaviour such that they are blank on load, and only red after a submit if fields were not entered? Seems to be a few states I have to use the built-in directives for. All the elements are similar so let’s just take apart this bit. Also if different for a radio […]

Onsen, AngularJS and previous-next buttons iOS

I use Onsen and Anguarlarjs to make my mobile app. The app having four tabs, tab two contains a form and tab four contain another form. When my app run in iOS platform, I fill two tab form and Apple keyboard show next-previous buttons. When the focus is on the last input, next button is enabled. If I click in next button, first input of the four page is focus and the tabs go out […]

Angular ng-class work with input[text] but not input[number]

I am new to angular and unfortunately running into an issue. I have the following input for a form: <div class=”form-group” ng-class=”{‘not-empty’: mailingzip.value}”> <input type=”number” name=”mailingzip” ng-minlength=”5″ ng-maxlength=”5″ ng-model=”mailingzip” class=”inputfield form-control” id=”mailingzip” required> <label for=”mailingzip” class=”animated-label”>Zip</label> </div> However, the class not-empty does not get applied to the div when there is an input. When I change the input type to “text” however, it all works perfectly. Is there a different attribute for input[number] which i […]

AngularJS – max validation not working on time input

I am writing an app with AngularJS 1.5.3. I have an input form with a time input box. I need to have validation on the box such that the user cannot pick a time in the future. Here is a snippet: <div ng-controller=”myController as accvm”> <form name=”accvm.addForm” novalidate> <div class=”item item-input” ng-class=”{ ‘has-error’ : accvm.addForm.time.$invalid }”> <span class=”input-label”>’Time'</span> <input name=”time” type=”time” id=”timeInput” max=”{{ accvm.data.maxTime | date:’HH:mm’ }}” ng-model=”accvm.data.time” ng-change=”accvm.timeChange()” style=”text-align: right” required /> </div> </form> […]

How to get an angular form to update after set value from dev console injected code?

how to How to get an angular form to update after set value from dev console injected code? So, I’m looking to automated some functions on a website that is not mine. I’m doing so with injected javascript code in the console so its all client side and several forms need to be triggered. No problem in standard javascript / html forms, but both react and angular apps, this poses a problem. For angular, they […]

Validate form only if one or more field contains a number, Angular.JS

how to Validate form only if one or more field contains a number, Angular.JS I want to validate an order form with Angular.JS. The form dynamically adds input fields depending on how many products there are. The dynamically added input fields are used to determine how many products the user wants to purchase. I want the form to validate if either one of the fields has a value of minimum 1 (the user has to […]

HTML form in ng-if environment

Structure of my app is like following: <div class=”parent”> <div class=”child” ng-if=”isShown”> <div class=”child-view-1″ ng-if=”!isShown”> </div> <div class=”child-view-2″ ng-if=”isShown”> </div> </div> </div> Inside child-view-2 I have form element, and of course, it is undefined in controller, probably beacuse of ng-if (as it creates child scope). isShown variable just switches divs from child-view-1 to child-view-2. What do you suggest, how can I make form visible all time in controller? Source: AngularJS

Next Page »