Category: General

Creating online forms with Google Docs and WuFoo

Designing the login form was one thing, but how about if you wanted to create something a little more lengthy and use it to obtain meaningful data from your readers. Well you may just find what you’re looking for using Google Doc’s new form builder. This is just one of the products that Google offers as part of their online productivity suite. As always you will find that the interface is clean and only takes a couple minutes to understand how to get it up and running. You can also specify required fields which is a nice touch.

The form results are displayed to you in a nice pie chart. The actual data is output into a spreadsheet behind the scenes if you need to use it for any other reason which is a nice touch as well.

An alternative service that I also recommend is called WuFoo. This service is free to try and allows for further customization of your web forms. I kid you not when I say that seemingly everything that you could ever want is included with this service such as phone number and date fields which include custom validation messages built in. There is a monthly fee as your usage increases however.

For me personally, Google Docs does just fine for my needs. Feel free to give your ice cream preference if you’d like to try out a sample form.

More

Creating a login form with jQuery

View Demo

Creating a login (or any form for that matter) can be trickier than it looks. After all how difficult can two text boxes a button and some labels be? There are different ways to accomplish this task, some using more proper semantically correct markup techniques than others. This example will attempt to give a real world case of how easy it can be to target elements contained inside the form with minimal scripting using the jQuery framework.

We’ll first start out with some html markup, notice the lack of css class attributes or JavaScript event handlers present.

<fieldset>
	<legend>Log In</legend>
	<p id="loginResult">Invalid login.. try again.</p>
	<form id="login" method="post">
		<dl>
			<dt><label for="username">Username:</label></dt>
			<dd><input id="username" type="text" /></dd>
			<dt><label for="password">Password:</label></dt>
			<dd><input id="password" type="text" /></dd>
		</dl>
		<p><input type="submit" value="Login" /></p>
	</form>
	<small>u:username / p:password</small>
</fieldset>

The next step we take is to target each element down the list and assign it a css class. We do this by using jQuery’s element specific selectors :text and :submit.

	$(function(){
		$('form#login :text').addClass('inputTextbox');
		$('form#login :submit').addClass('inputSubmitBtn');
	});

Next, we’ll add the event handler for the submit button by using .click(). To make things easier on ourselves we could always shorten our code by chaining the click event at the end of our submit button selector which was already defined in the previous step.

$('form#login :submit').addClass('inputSubmitBtn').click(function() {
     // click event code
}

Throw in an animation for good measure to display a message for invalid attempts and you’re good to go. Here is the full JavaScript code we’re working with.

		$(function(){
			$('form#login :text').addClass('inputTextbox');
			$('form#login :submit').addClass('inputSubmitBtn').click(function(){
				if($('#username').val() != "username" || $('#password').val() != "password")
				{
					for(i=0;i<5;i++)
						$("#loginResult").animate({opacity: 'toggle'}, 500 );	
						
					$("#loginResult").fadeIn(500);					
					return false;
				};
			});
	    });
More

Upcoming Events for Web Developers


An Event Apart
August 18–19, 2008 San Francisco, CA & October 13–14, 2008 Chicago, IL

Join Eric Meyer, Jeffrey Zeldman and special guests to gain a deeper understanding of web standards and emerging best practices. Be inspired by fresh ideas and new directions. Join the greatest minds and hottest talents in web design today.



The Ajax Experience
September 29 – October 1, 2008 in Boston, MA

The only Web 2.0 development event created by developers, the real experts working in the trenches who have encountered and conquered today’s most pressing pain points. The Ajax Experience is the original and most in-depth rich internet application conference addressing cutting edge topics, from cross-browser compatibility to how to choose the right framework and everything in between. We bring you sessions on performance, scalability, server-side and client-side development, and JavaScript from industry experts who face the same day-to-day challenges as you do. Whether you’re a designer, developer, tester or manager, The Ajax Experience provides you with sessions to take your skills to the next level and enhance your professional development. Guaranteed.



Future of Web Apps
October 8-10, 2008 in London (San Francisco and Miami have also hosted)

The Future of Web Apps showcases the successful web technologies and business trends of the future, delivered by the pioneers of today. Attended by all the major European and US start-ups and industry experts, it’s the best place to learn directly from the developers, designers and entrepreneurs behind the web’s brightest stars in a relaxed and fun environment.



The Future of Web Design
November 3-4, 2008 in New York, NY

Join world-leading web designers in NYC for one day of inspiration, advice and best practice.



(SXSW) South by Southwest Interactive
March 13-17, 2009 in Austin, TX

The SXSW Interactive Festival features five days of exciting panel content and amazing parties. Attracting digital creatives as well as visionary technology entrepreneurs, the event celebrates the best minds and the brightest personalities of emerging technology. Whether you are a hard-core geek, a dedicated content creator, a new media entrepreneur, or just someone who likes being around an extremely creative community, SXSW Interactive is for you!


Mixx 2009
March 18-20, 2009 Las Vagas, NV

MIX is an ongoing conversation between web designers, developers, and business decision makers. We showcase topics and solutions that bridge Microsoft and non-Microsoft perspectives, and emphasize the inclusive and participatory nature of the next web.

More

How To Spot A UI Guru

gu·ru (gŏŏr’ōō, gŏŏ-rōō’)
n. pl. gu·rus

  1. A trusted counselor and adviser; a mentor.
  2. A recognized leader in a field: the guru of high finance.

There is a definitive line between the skill set of a front-end (what you see and do on a web page) and a back-end (what happens behind the scenes.. think e-commerce). Depending on the size of the development team, the same person may or may not fill the shoes of both roles. You can always spot the front-end developers of a company because of their rhino Javascript O’Reilly book and at least one or two CSS books for reference. Additionally these developers will have at least two browsers installed on their machine for testing purposes.

Some gurus prefer to be considered designers, some call themselves developers while in actuality you really should have a little bit of both skills to become efficient at the trade. There is certainly an art to designing a usable yet visually appealing website. Although looks don’t always equal a usable design, we try to make it as nice as possible anyways. Many times the page markup itself will be a work of art in its own right as this sample from css zen garden demonstrates:

<div id="container">
	<div id="intro">
		<div id="pageHeader">
			<h1><span>css Zen Garden</span></h1>
			<h2><span>The Beauty of <acronym title="Cascading Style Sheets">CSS</acronym> Design</span></h2>
		</div>

		<div id="quickSummary">
			<p class="p1"><span>A demonstration of what can be accomplished visually through <acronym title="Cascading Style Sheets">CSS</acronym>-based design. Select any style sheet from the list to load it into this page.</span></p>
			<p class="p2"><span>Download the sample <a href="/zengarden-sample.html" title="This page's source HTML code, not to be modified.">html file</a> and <a href="/zengarden-sample.css" title="This page's sample CSS, the file you may modify.">css file</a></span></p>
		</div>

		<div id="preamble">
			<h3><span>The Road to Enlightenment</span></h3>
			<p class="p1"><span>Littering a dark and dreary road lay the past relics of browser-specific tags, incompatible <acronym title="Document Object Model">DOM</acronym>s, and broken <acronym title="Cascading Style Sheets">CSS</acronym> support.</span></p>
			<p class="p2"><span>Today, we must clear the mind of past practices. Web enlightenment has been achieved thanks to the tireless efforts of folk like the <acronym title="World Wide Web Consortium">W3C</acronym>, <acronym title="Web Standards Project">WaSP</acronym> and the major browser creators.</span></p>
			<p class="p3"><span>The css Zen Garden invites you to relax and meditate on the important lessons of the masters. Begin to see with clarity. Learn to use the (yet to be) time-honored techniques in new and invigorating fashion. Become one with the web.</span></p>
		</div>
	</div>
</div>

If your web page markup at all resembles this then you are well on your way to being a UI guru. Gurus go to extreme lengths to ensure that their sites both function and appear identical to the most users as possible and in today’s Internet is is no small feat. If you think this is an accomplishment, consider the fact that beyond the basic concepts many gurus are self taught. While schools teach the fundamentals of making a functional website they likely won’t get into the facets of designing a quality site that appeals to everyone. Web standards, usability, search optimization are all topics that I myself have had to lean independently of college. What’s so nice about the web platform is that markup is open for any software or technology to develop on, this is most apparent when it comes to the type of application to develop with. While not always the case, these applications are encouraged to abide by the standards put in place by the World Wide Web Consortium (W3C). In time you will learn not to rely on the application to format your markup and be able to write code with just about anything.

For all of those aspiring UI gurus out there, perhaps the best way to learn UI is through trial and error. We learn new concepts and solutions to problems by talking with colleagues and by spiking out through web searches for ways to improve our skills. We also learn by closely following websites authored by industry leaders and finding ways to add our own unique twist to those concepts. Books and websites alone aren’t enough to become proficient, just like anything, the more you practice the better you become.

Recommended books

JavaScript: The Definitive Guide, Fifth Edition
CSS Mastery
Bulletproof Web Design

Recommended Websites

Nettuts.com
A List Apart
Think Vitamin

More

Using jQuery Selectors

jQuery Selectors are a powerful feature of the framework that is essentially one of the main reasons that you’d want to use it in the first place. Those who are already familiar with how CSS3 selectors work will feel right at home with the concept of selectors. Today’s modern browsers at best support “most” of the CSS3 specification (with Firefox 3 & Safari), while others use only limited features of it. What’s so nice about jQuery is that the browser doesn’t need to support the CSS3 specification for you to use them within the framework itself. Those familiar with XPath will also be happy to know that simple XPath selectors are also supported via a plugin for jQuery if preferred. Here are some examples to demonstrate the power of selectors:

Style alternate table rows

$("table#mytable tbody tr:even").addClass("alt");

Add text based on a link’s file extention

$("a[href$=.pdf]").append(" (pdf download)");

Style links to external sites

$("a[href^=http://]").addClass("external");

Keep in mind that these are one line of code each that would otherwise take somewhere between 5 and 10 lines of javascript. As an added benefit, they also will execute as soon as the document object model is ready since the “$” shortcut function performs this for us behind the scenes. It is essentially waiting for the earliest time that the script is able to run, when all markup has been loaded (but not images or flash videos) so that we’re not having to wait for larger files to load before hand.

jQuery also has custom selectors which act like shortcuts for some common tasks. For example, you can find all buttons with $(:button), find all checkboxes with $(:checkbox), etc. If you would like to learn more, there is a jQuery selector documentation on their website as well.

More