<input type="password" id="password">
<span id="warning" style="display:none;color:#c00">[Caps Lock]</span>
<script>
document.getElementById("password").addEventListener("keyup", function(event) {
document.getElementById("warning").style.display = (event.getModifierState("CapsLock")) ? "inline" : "none";
});
</script>
Replace Bootstrap’s JavaScript Form Validation with jQuery Equivalent – Plus Focus First Invalid
I tend to implement Bootstrap > Documentation > Components > Forms > Validation but feel it makes sense to use jQuery since it is required by many Bootstrap components 🤷♂️
Code to replace provided example…
Continue readingTick All Checkboxes With Vanilla JavaScript or jQuery
Here for me to copy/paste as-needed… feel free to do the same 💁♂️
Vanilla JavaScript
var inputs=document.getElementsByTagName('input');for(var i=0;i<inputs.length;i++){if(inputs[i].type=='checkbox'){inputs[i].checked=true;}}
jQuery Equivalent
$('input:checkbox').prop('checked',true);
Happy coding 😀
VBA EXCEL: Mirror Comments to Matching Cells of Another Spreadsheet in the Same Workbook
I have an Excel workbook with 13 protected sheets, January through December plus a Summary that needed the same cell comments for each month.
There were 2 options…
- Type comments into each sheet manually; then update 11 sheets (Feb-Dec) by hand whenever comments need changing 😬
- Add VBA code to the workbook that automatically duplicates cell comments from January (unprotected) to February through December (protected) when those sheets are activated 😎
How to Whitelist Emails & Domains in Outlook.com (MSN, Hotmail, Live, etc)
You ever go looking for an email only to find it in your Junk Mail folder? Here are a few ways to whitelist senders and/or domains avoid the issue.
Individual Messages
This method effectively whitelists the sender of a single message and moves it to your “Inbox” folder.
Continue readingKnow When Visitors Arrive Using LiveZilla Windows App
One of the things that kinda bugged me about the LiveZilla Windows App was the inability to know what’s going on without being in the actual app. Simply put, there are no visual or audible notifications except for chat requests.
Today I finally decided to figure out a better way to monitor my web traffic… Events!
Continue readingAdd Pattern Support for HTML5 Input Type Number with jQuery
Ran into an issue earlier today that I could not figure out and ended up asking my second question on StackOverflow in seven years.
I was trying to use <input type="number" pattern="[0-9]{8}">
to enforce 8-digit numbers while allowing leading zeros. This was being done on an optional field (no required
attribute) and I could not understand why it was bypassing my pattern on the populated field (eg: value “1234” was accepted, pattern ignored).
Open Graph Meta Tag Generator That Supports Multiple Images
Just wrapped up an addition to Social Link Generator. Now you can also generate Open Graph meta tags!
One thing that sets my tool apart from the crowd is the ability to specify images, and more than just one!
Plus, the majority of valid og:type
selections are included for convenience 😉
Quickly Generate Sharing Links for Social Media Sites Like Facebook, Twitter and Pinterest Without Javascript
Provide as little as a page URL or the kitchen sink to generate sharing links that have no javascript requirements for your website.
Check it out: Social Link Generator
Continue readingHow to Continue Using Buttons with “data-loading-text” in Bootstrap 4 with jQuery
While converting a Bootstrap 3 template design for use with Bootstrap 4, I noticed they removed stateful buttons (eg: “loading” and “reset” button states) from BS4! Granted it was mentioned in BS3, but I never noticed the deprecated warning 🙁
The deprecated code for showing a button’s loading state was $('#selector').button('loading')
and to return the button to its original state you would use $('#selector').button('reset')
.
Add Mouse Wheel Support to Bootstrap Carousel with jQuery
I was adding mouse wheel events to a ul
element with the CSS rule overflow:hidden
to emulate mouse wheel scrolling when no scrollbar was present.
The links in the unordered list also trigger a Bootstrap 4.1 Modal that contains a Bootstrap Carousel. So I decided to add the same functionality to my modal carousel gallery.
Continue readingAdd Microsoft Edge to Dreamweaver’s “Preview in Browser” List
According to Adobe, to use Microsoft Edge as a preview browser in Windows 10, you should do this…