Angular2 – How to set `touched` property on form to true

There’s a pretty straightforward method to do this: markAsTouched. It should be enough to use it on the form group. this.addressForm.markAsTouched() In case you want for some reason to mark all controls manually, they itself have this method available. markAsTouched is a method of the AbstractControl all form elements inherit from. Out of curiosity, you … Read more

What’s the difference between novalidate and formnovalidate attributes of HTML5?

novalidate is applied to the form, and prevents it from being validated; formnovalidate is applied to a submit button, and overrides the novalidate option, if present; it means ‘submit this form without validating, regardless of the general form setting’. The example given in the spec is when a user is saving data rather than publishing … Read more

How to get file upload without a form

The Request has a FileBag, similar to the ParameterBag So I could get the file specified easily with: $data = $this->getRequest()->request->all(); $file = $this->getRequest()->files->get(‘file’); and use the document as is from the cookbook: $document = new Document(); $document->setFile($file); $lead->setDocument($document);

Adding causes java.lang.IllegalStateException: Cannot create a session after the response has been committed

This is a known problem and has been reported by yours truly as issue 2215. This will occur when the response buffer has overflowed (due to large content) and the response is been committed before the session is been created. This is result of bit overzealous attempts of Mojarra to postpone “unnecessary” session creation as … Read more

Comparing two input values in a form validation with AngularJS

You should be able to use ng-pattern/regex for comparing 2 input values Email:<input type=”email” name=”email1″ ng-model=”emailReg”> Repeat Email:<input type=”email” name=”email2″ ng-model=”emailReg2″ ng-pattern=”emailReg”> and validation with: <span ng-show=”registerForm.email2.$error.pattern”>Repeat Email should have the same value with email!</span>

Autofill populating wrong fields

The OP’s problem may have been solved (or may have come back again in recent updates!) but as of early 2019, you can diagnose some of these problems by setting the show-autofill-type-predictions flag in chrome://flags, restarting Chrome, then looking at the title (tooltip text) for the input in question. It will tell you what information … Read more