For Attribute Used With Label Tags
There are times that I feel like I am on the cutting edge of development. Web 2.0 and AJAX trickery gives me that feeling all the time. Then there are times where I ask myself, “Why didn’t I know about this before?” That’s how I feel about the for attribute for the <label> tag.
I found this little gem a few weeks ago, and after my collegues stopped laughing at me, I was told that this was nothing new. The for attribute has been around for a while, and is a helpful bit of HTML.
Found inside of a <label>, and next to an <input>, the for attribute can provide an end user a little bit more functionality from your form.
<label for=”radioName”>Label name</label><input type=”radio” name=”radioName” />
where the for attribute is the same as the id attribute for the corresponding <input>
With the for attribute used, the user can either click on the radio button itself, or the much larger target, the label text.
Using the for attribute will also help those using speech browsers.
I like these small little bits, espcially in a form with a lot of radio buttons. Having a secondary place for your audience to click might not make the difference on your conversion, but it sure is a nice touch.
A Fight To The Finish
I am currently employed full time as Lead Designer at a shop that is an exclusive vendor (or at least tries to be) of Microsoft products. “If Microsoft can produce it, we’ll buy it.” Personally, .NET is of little interest to me. I prefer to code inside of PHP. I can forsee that I will have certain biases for PHP, I admit that. But what is frustrating for me is all the hate from my co-workers.
Having the title of designer at work makes it hard enough to put up a fight for PHP at work, but when I attempt to add in a few thoughts here and there about a theoretical code procedure, I am shot down; FAST! Forget the fact that .NET is an application framework and PHP is a language. Forget the fact that PHP is open source, and .NET is not. And forget the fact that because of that, its like comparing apples to oranges. The fact of the matter is that PHP is just as viable of a coding language as .NET is a framework.
I wont argue that .NET is a highly flexible framework, building both website and standalone applications. I wont argue that PHP is primarily, if not exclusively, focused on websites. But what I will argue is that PHP is not vastly inferior to .NET because of one reason, pre-compiled code.
.NET pre-compiles its code before it is published out to a live server. PHP is not. For this one simple fact, every .NET developer I work with say that .NET is superior. But why? Why would I want to republish entire sites because of a simple code change? Why would I want to add an additional step to the process, when I can simply add/remove a function, move that page up to the server, and be done with it?
To me, and I might be the naive one here, I prefer the simplicity of this process. Time and time again, I have seen my fellow coworkers wait and wait for a website to compile and be published to a server. Which, might be a small preference in the grand scheme of things, but I just want to be done with it.
So to my co-workers I say Ni!
Ni!
Ni!
Sure you can make other arguments about the dominance of .NET to PHP, and I will listen. With deaf ears I will listen. Phooey on you for thinking that .NET is so much greater of a product than PHP. –With the advent of PHP5, your arguments for superiority grow thin (OOP support hint hint, nudge nudge).
Rest assured that one day, you will be hearing your fellow developers ask “you want this in PHP or .NET? there is really no difference”.
