Category Archives: HTML

Generate HTML drop downs from arrays & ranges with a PHP class

There comes a time (or a multitude of times) where a developer finds him- or herself rewriting the same code over and over again. Eventually, we get tired of it and need to find a solution. Recently, I frequently found myself writing code to generate HTML drop downs.  This became tedious, and I started to think it was unnecessary. But wait!  There must be a better way!  I didn’t want to use Zend_Form or any other 3rd party solution; I wanted to create my own class to help take care of this problem.  Below is the code/examples for the class, then a description of some of the methods, and lastly a link to download the source code.  As you can see, there are some nice features, and the class is easy to use and extend. Continue reading Generate HTML drop downs from arrays & ranges with a PHP class

IE6 is still not dead, and why we are to blame

While Internet Explorer 6 is still alive and breathing, it is dying a slow death, too slow for our liking as web developers.  The process has been long and arduous.  With the advent of CSS3 and HTML5, browsers like IE6 are like the cars with carburetors and low MPG ratings.  They harm the environment, create an unpleasant atmosphere for development, and we need a virtual Cash for Clunkers to fix it. Continue reading IE6 is still not dead, and why we are to blame

Create a slide down menu with toggle button using jQuery

Recently, I have come to find myself recreating the same code over and over again for jQuery slide down menus equipped with one button to toggle display. There’s nothing complex about this code, but it will give beginners the gist of how to do accomplish the task. For this example, we will use jQuery 1.3.2, delivered from Google’s CDN.

On a side note, using a CDN like Google’s can lessen the load on your server, and will actually help reduce overall bandwidth usage on the web as whole. If a visitor has already downloaded the jQuery library from Google’s CDN, the majority of the time they won’t need to do it a second time if you implement this strategy.

The Google CDN address for jQuery 1.3.2 can be implemented using the following code:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

HTML:

<input type="button" id="hidden_menu_button" value="Toggle Menu" />
<div id="hidden_menu" style="display: none;">
	<label><input type="checkbox" />Checkbox #1</label>
	<label><input type="checkbox" />Checkbox #2</label>
</div>

JavaScript:

<script type="text/javascript">
(function($) {
	$("#hidden_menu_button").click(function() {
		if ( $("#hidden_menu").is(":hidden") ) {
			$("#hidden_menu").slideDown("normal");
		} else {
			$("#hidden_menu").slideUp("normal");
		}
	});
})(jQuery);
</script>

View Demo

25+ Must-Have Cheat Sheets for Web Developers

Who wants to go to Google or break out the library of programming books every single time you get stuck on something? Below is a compilation of extremely useful cheat sheets, which can be printed, laminated and placed nearby for easy reference while doing your web development and design. Everyone has moments where a function cannot be remembered, and that is where these cheat sheets can be lifesavers. Bookmark this page for an easy portal to all of the cheat sheets, or an individual page if you find it helpful. Please don’t hesitate to post any cheat sheets we neglected to include, for this is about sharing knowledge.

1. PHP

PHP Cheat Sheet

http://www.addedbytes.com/cheat-sheets/php-cheat-sheet/ Continue reading 25+ Must-Have Cheat Sheets for Web Developers