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

Angular2 – Radio Button Binding

use [value]=”1″ instead of value=”1″ <input name=”options” ng-control=”options” type=”radio” [value]=”1″ [(ngModel)]=”model.options” ><br/> <input name=”options” ng-control=”options” type=”radio” [value]=”2″ [(ngModel)]=”model.options” ><br/> Edit: As suggested by thllbrg “For angular 2.1+ use [(ngModel)] instead of [(ng-model)] “

How to write “Html.BeginForm” in Razor

The following code works fine: @using (Html.BeginForm(“Upload”, “Upload”, FormMethod.Post, new { enctype = “multipart/form-data” })) { @Html.ValidationSummary(true) <fieldset> Select a file <input type=”file” name=”file” /> <input type=”submit” value=”Upload” /> </fieldset> } and generates as expected: <form action=”/Upload/Upload” enctype=”multipart/form-data” method=”post”> <fieldset> Select a file <input type=”file” name=”file” /> <input type=”submit” value=”Upload” /> </fieldset> </form> On the … 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

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

How to open a new window on form submit

No need for Javascript, you just have to add a target=”_blank” attribute in your form tag. <form target=”_blank” action=”http://example.com” method=”post” id=”mc-embedded-subscribe-form” name=”mc-embedded-subscribe-form” class=”validate” >

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