It’s easy to strip non-numbers from a php string. This is common when attempting to format fields like phone numbers or money amounts for entry into a database. Learn the code.

You can find a lot of search engine results when you look for methods to block the highlighting of text in your HTML. Unfortunately, the top results for disabling text selection either aren’t fully supported (the CSS way) or could cause scripting errors. I’ll explain inside.

There’s a lot of syntax to remember when dealing with JS events, so I figured it would be a good idea to compile a reference list that covers all types of events and the proper syntax to use them. See the examples.

In my last scripting article, I showed you how to use native JavaScript to disable mouse wheel scrolling and re-enable it afterwards. Now that you know it (you read it right?), I will show you the simpler MooTools way. All in 2 lines of code.

I occasionally need to block mouse wheel scrolling when I’m working with JavaScript. Of course, this is only momentary, such as when I need to display an overlay of some sort. See how to do it properly

So you want to open a drop down select box without clicking on it? For years, people have been looking for the answer to this question. While everything else on the web has been changing since, the answer to this question remains the same. See the answer

Web development covers a lot of material, and even someone like myself who has done it for years can forget stuff many times before it sets in. We all have those *facepalm* moments. In this article, I will discuss what can and can’t be done with the id and name attributes, and why. (more…)

If you deal with more than external JavaScript file on a web page, it is only a matter of time before you run into a problem with window.onload. If two scripts each use window.onload, then the first function gets overwritten by the second. Learn how to handle it here.

I often need to add events to an element inside a JavaScript loop. If you’ve ever done this before, you know that it wont work unless you change the syntax properly, the event will always fire on the last item in the loop. In this article I will show you the simple concept of using a closure around the event to make it work properly. See the closure.

PHP has the built-in function called array_splice() to remove an item from an array. However, the function alone does not help you remove a certain item from an array. Since I just wrote an article on this topic for JavaScript, it’s only proper I cover it in PHP as well. Read How