Show red border for all invalid fields after submitting form angularjs

Reference article: Show red color border for invalid input fields angualrjs I used ng-class on all input fields.like below <input type=”text” ng-class=”{submitted:newEmployee.submitted}” placeholder=”First Name” data-ng-model=”model.firstName” id=”FirstName” name=”FirstName” required/> when I click on save button I am changing newEmployee.submitted value to true(you can check it in my question). So when I click on save, a class … Read more

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

Can you require two form fields to match with HTML?

Not exactly with HTML validation but a little JavaScript can resolve the issue, follow the example below: function check() { var input = document.getElementById(‘password_confirm’); if (input.value != document.getElementById(‘password’).value) { input.setCustomValidity(‘Password Must be Matching.’); } else { // input is valid — reset the error message input.setCustomValidity(”); } } <p> <label for=”password”>Password:</label> <input name=”password” required=”required” type=”password” … Read more

HTML slider with two inputs possible?

I’ve been looking for a lightweight, dependency free dual slider for some time (it seemed crazy to import jQuery just for this) and there don’t seem to be many out there. I ended up modifying @Wildhoney’s code a bit and really like it. function getVals(){ // Get slider values var parent = this.parentNode; var slides … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)