2019, Chrome 76, approach to autocomplete off

Update, January 2020: It appears that as of Chrome 79, Autocomplete (as defined here) no longer treats autocomplete=”some-unrecognised-value” as equal to autocomplete=”on”, so autocomplete=”nope” or similar is now effective at disabling both Autocomplete and Autofill. Update, April 2020: They changed it again. As of Chrome 81, autocomplete=”some-unrecognised-value” is no longer effective at disabling the Autocomplete … Read more

Nodejs POST request multipart/form-data

After some more research, I decided to use the restler module. It makes the multipart upload really easy. fs.stat(“image.jpg”, function(err, stats) { restler.post(“http://posttestserver.com/post.php”, { multipart: true, data: { “folder_id”: “0”, “filename”: restler.file(“image.jpg”, null, stats.size, null, “image/jpg”) } }).on(“complete”, function(data) { console.log(data); }); });

Validation in HTML5. :invalid classe after submit

I used this approach for a project of mine, so the invalid fields would be highlighted only after submit: HTML: <form> <input type=”email” required placeholder=”Email Address”> <input type=”password” required placeholder=”Password”> <input type=”submit” value=”Sign in”> </form> CSS: input.required:invalid { color: red; } JS (jQuery): $(‘[type=”submit”]’).on(‘click’, function () { // this adds ‘required’ class to all the … Read more

Can I trigger a form submit from a controller?

You can add submit method to a FormController. I did so: <form ng-form-commit action=”https://stackoverflow.com/” name=”payForm” method=”post” target=”_top”> <input type=”hidden” name=”currency_code” value=”USD”> <button type=”button” ng-click=’save(payForm)’>buy</button> </form> .directive(“ngFormCommit”, [function(){ return { require:”form”, link: function($scope, $el, $attr, $form) { $form.commit = function() { $el[0].submit(); }; } }; }]) .controller(“AwesomeCtrl”, [“$scope”, function($scope){ $scope.save = function($form) { if ($form.$valid) { … Read more

How to show/hide an element in real time (Blazor)?

The hidden html attribute also works to hide an element. <p hidden>This paragraph should be hidden.</p> To bind to Model: <p hidden=”@HideLabel”>I am Hidden When HideLabel == true</p> <p hidden=”@(!HideLabel)”>I am Hidden when Hidelabel == false</p> <button @onclick=”@Toggle”>Show/Hide</button> @code { private bool HideLabel { get; set; } = false; private void Toggle() { HideLabel = … Read more

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