HTML5: 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

Uploading file using Google Apps Script using HtmlService

Have the button run the server side function using google.script.run, passing in the entire form as the only parameter. (Inside the button’s onClick, ‘this’ is the button, so ‘this.parentNode’ is the form.) Make sure to give the file input a name. <html> <body> <form> <input type=”file” name=”theFile”> <input type=”hidden” name=”anExample”> <input type=”button” onclick=”google.script.run.serverFunc(this.parentNode)”> </form> </body> … Read more

What is &amp used for

& is HTML for “Start of a character reference”. &amp; is the character reference for “An ampersand”. &current; is not a standard character reference and so is an error (browsers may try to perform error recovery but you should not depend on this). If you used a character reference for a real character (e.g. &trade;) … Read more

Can you require two form fields to match with HTML5?

Not exactly with HTML5 validation but a little JavaScript can resolve the issue, follow the example below: <p>Password:</p> <input name=”password” required=”required” type=”password” id=”password” /> <p>Confirm Password:</p> <input name=”password_confirm” required=”required” type=”password” id=”password_confirm” oninput=”check(this)” /> <script language=”javascript” type=”text/javascript”> function check(input) { if (input.value != document.getElementById(‘password’).value) { input.setCustomValidity(‘Password Must be Matching.’); } else { // input is valid … Read more

Angular: composite ControlValueAccessor to implement nested form

Couple issues, on your AppComponent change your FormBuilder to: this.form = fb.group({ name: ‘foo bar’, address: fb.control({ //Not using FormGroup city: ‘baz’, town: ‘qux’, }) }); On your AddressFormComponent you need to initialize your FormGroup like so: form: FormGroup = new FormGroup({ city: new FormControl, town: new FormControl }); Here’s the fork of your sample: … Read more

Angular 2 – large scale application forms’ handling

I commented elsewhere about @ngrx/store, and while I still recommend it, I believe I was misunderstanding your problem slightly. Anyway, your FormsControlService is basically a global const. Seriously, replace the export class FormControlService … with export const formControlsDefinitions = { // … }; and what difference does it make? Instead of getting a service, you … Read more

Angular 2: Can’t bind to ‘ngModel’ since it isn’t a known property of ‘input’

Figured out quick solution, update your @NgModule code like this : import { NgModule } from ‘@angular/core’; import { BrowserModule } from ‘@angular/platform-browser’; import { FormsModule } from ‘@angular/forms’; import { AppComponent } from ‘./app.component’; @NgModule({ imports: [ BrowserModule, FormsModule ], declarations: [ AppComponent ], bootstrap: [ AppComponent ] }) export class AppModule { } … Read more