It's surprising that there are still HTML forms online not taking advantage of the <label> tag. In addition to being required for creating accessible forms, <label> tags improve the usability of forms. For example, instead of forcing visitors to click those tiny radio buttons, why not let them to click the text label. Continue reading →
Making HTML Forms More Accessible and Improving Usability with the Label Tag
February 20, 2012 — Tags: accessibility, HTML, HTML Forms
Generate Usernames with JavaScript: Working with Short Last Names
February 13, 2012 — Tags: HTML, HTML Forms, JavaScript
When generating usernames, one thing to consider is the length of the username. The code from last week's post may be problematic if you're looking for the username to be five characters or more and the user's last name is only two characters. After tacking on the first initial, you would only have three characters. So let's look at getting closer to the desired results. Continue reading →
Using JavaScript to Dynamically Generate the Username within an HTML Form
February 6, 2012 — Tags: HTML, HTML Forms, JavaScript
Usernames are typically made up of some combination of the user's first and last name. If that's the case, the form used to create those usernames could be modified to take advantage of the data in the first and last name fields. Instead of making someone manually type the username, JavaScript could be employed to generate it automatically. Continue reading →
Slicing Strings with PHP: Be Mindful of Output that Contains HTML Tags
December 12, 2011 — Tags: HTML, PHP
When experimenting with strings which contain HTML code, be mindful of what you're getting for output. Especially if there is something unexpected about the results. That's what I learned the hard way when extracting an open anchor tag from the source code of a web page. The variables used to locate the anchor tag appeared to be working, but for some reason the extracted code wouldn't display to the screen. Let's take a look at where I went wrong. Continue reading →
Sorting HTML Data Tables Part 2: Dynamically Sort in Ascending and Descending Order
November 19, 2011 — Tags: database, HTML, PHP
In last week's post we looked at dynamically sorting HTML data tables. But we only talked about sorting the columns in either ascending or descending. If the user is looking for a last name that appears near the end of the alphabet and the column is sorted from A to Z, they may have a lot of names to go through before finding the one they want. Instead we could provide an option for sorting in both descending and ascending order. Continue reading →
Sorting HTML Data Tables Using the Header Row with PHP
November 14, 2011 — Tags: database, HTML, PHP
When displaying a data tables, how do you usually sort the information? Do you sort by the field that you think is the most important to the visitor? For example, it's perfectly acceptable to show a list of order by date; showing the newest order first. But what if the user wants the data organized differently? We could let them choose the column to sort by. Continue reading →
Making Sure that Updates Were Applied to a Web Page with HTML Comments
October 24, 2011 — Tags: code comments, HTML
When modifying a website, the effects to the page are usually apparent. But when the changes only affect the backend, how do you know you're not viewing the old page? A successful update results in the same content being displayed as before the changes. Maybe the updated page was uploaded to the wrong location. Let's see how HTML comments can help. Continue reading →
Three Simple Methods for Hiding Website Content Until It’s Ready
October 10, 2011 — Tags: archive, code comments, HTML, PHP
How do you handle content that needs to be temporarily removed from a website? Maybe there is some text that gets recycled on a regular basis or something that hasn't been approved for posting yet. HTML comments could be utilized to hide everything until it's ready to go live. Just keep in mind that the content is still accessible via the browser for those who know where to look. If that's an issue, the information could be moved to a separate file and saved offline…or you could use PHP comments. Continue reading →
Why Doesn’t My Submit Button Display the Entire Label: The Importance of Using Quotes with HTML Attributes
July 25, 2011 — Tags: HTML
Several years back, there was a big push from the Web community to use a glorious advancement called XHTML. Although some will argue that XHTML movement was pointless, it at least changed the habits of developers like me who were a little loosey-goosey with standards. One of which is the use of quotes around all attributes, or lack thereof. Although the page may display fine without quotes, there are cases where the code won't work as expected. Continue reading →
Developing a Simple Website Template with PHP
January 24, 2011 — Tags: HTML, PHP, template
When developing websites it's always a good idea to look for ways to make the final product easier to maintain. For websites which contain more than a couple of pages, it can be a real time saver if you build them utilizing a template. Continue reading →
