Home > Archive > Customize Your Online Forms

March 12, 2004

Customize Your Online Forms

 Small Business Web Design

Over two years in development,
Web Design Mastery
is your complete guide to
learning professional Web Design... Specially designed for small businesses, it is packed with
the exact information you need
to succeed.
 

To make the most out of your website you must offer some sort of interactive feature. The easiest way to allow your users to give you feedback is by using forms that your visitors can easily fill up to send you information and comments.

You don't have to settle for the boring default settings for forms (usually a blank rectangle for the entries and a gray rectangle for the submit or send buttons). You can customize these form elements to go with the look and feel of your site.

Your standard forms will look something like this (we're using a simple one box form that will email your email address to the recipient; however, these instructions can be used with any form):

Your Email:


The HTML code for that simple form is:

<form ACTION="mailto:recipient@recipientdomain.com">
<p><strong>Your Email:</strong><input name="Email" value size="10">
<input type="submit" value="Submit"></p>
</form>


To change the appearance of the entry box so that it is surrounded by a rectangle with a one-pixel wide colored border, you can use the style attribute as follows:

<form ACTION="mailto:recipient@recipientdomain.com">
<p><strong>Your Email:</strong><input name="Email" value size="10" style="border: #000080 1px solid">
<input type="submit" value="Submit"></p>
</form>


In this case, we have specified a navy blue, one pixel wide solid border surrounding the input box. Your form will look like this:

Your Email:


Now, let's suppose we want to color the inside of the input box (we will use a light blue color). The code will look like this:

<form ACTION="mailto:recipient@recipientdomain.com">
<p><strong>Your Email:</strong><input name="Email" value size="10" style="border: #000080 1px solid; background: #80ffff;">
<input type="submit" value="Submit"></p>
</form>


The form will look like this now:

Your Email:


Now, let's suppose that we want to change the border and color of the submit button so that its border is a solid one pixel wide navy blue line and the interior is light blue. The code will look like this:

<form ACTION="mailto:recipient@recipientdomain.com">
<p><strong>Your Email:</strong><input name="Email" value size="10" style="border: #000080 1px solid; background: #80ffff;">
<input type="submit" value="Submit" style="border: #000080 1px solid; background: #80ffff;"></p>
</form>


The result will look like this:

Your Email:


Now, if you want to replace the submit button with a graphic element, like this one:



you have to change the code as follows:

<form ACTION="mailto:recipient@recipientdomain.com">
<p><strong>Your Email:</strong><input name="Email" value size="10" style="border: #000080 1px solid; background: #80ffff;">
<input type="image" src="http://www.accordmarketing.com/tid/images/btn_ftr_submit.gif" align="absmiddle" name="Submit Button"></p>
</form>


The location of the button in this case is: "http://www.accordmarketing.com/tid/images/btn_ftr_submit.gif" and the result will look like this:

Your Email:


Finally, if you want to decorate the inside of the input box with a graphic image instead of color, you must change the code as follows:

<form ACTION="mailto:recipient@recipientdomain.com">
<p><strong>Your Email:</strong><input name="Email" value size="10" style="border: #000080 1px solid; background: url(http://www.accordmarketing.com/tid/images/lightstars.jpg)">
<input type="image" src="http://www.accordmarketing.com/tid/images/btn_ftr_submit.gif" align="absmiddle" name="Submit Button"></p>
</form>


The image we chose is this:



The result will look like this:

Your Email:


If by any chance your form includes a comment box that has a scrollbar, you can use the following code, and change the scrollbar's colors as you wish:

<form METHOD="post" ACTION="/cgi-bin/example.cgi"><p>
<textarea wrap="virtual" name="comments" rows="6" cols="20"
STYLE="background:#f0f0f0;
scrollbar-face-color: #80ffff;
scrollbar-track-color: #80ffff;
scrollbar-arrow-color: #000080;
scrollbar-3dlight-color: #000080;
scrollbar-shadow-color: #000080;
scrollbar-highlight-color: #000080;
scrollbar-darkshadow-color: #000080">This example
displays a form with colored scrollbars.
</textarea>
<input type="Submit" VALUE="Submit"
STYLE="color: #000000; border: 1px solid;
background:#ffffff;"></p>
</form>


Your form will look like this:


You can play around by changing the colors assigned to the scrollbars, text area background and submit button to create the look that suits you best.

You can also specify your form attributes in a cascading style sheet.  That way, if you make any changes, these will apply to all the forms on your site, so you won't need to make your changes in each and every form.

These tips should be enough to make some basic modifications that add fun and sophistication to your forms, so that they better blend with the look and feel of your site.bd14582_.gif (185 bytes)

For more HTML tips and tricks check out Shelley Lowery's Web Design Ebook (Web Design Mastery)


You can freely reprint this article provided that you include the following resource box:

Mario Sanchez is a Miami based freelance writer who focuses on Internet marketing and web design topics.  He publishes The Internet Digest ( http://www.theinternetdigest.net ), a growing collection of web design and Internet marketing articles, tips and resources.  You can freely reprint his weekly articles in your website, ezine, or ebook.


Recommended Reading:

Defensive Design for the Web: How To Improve Error Messages,Help, Forms, and Other Crisis Points: (by 37signals) The folks at world-class redesign firm 37signals have brought to life the topic of forms, confirmation pages, error messages and 404 pages.  Following the tips in this book can make the difference between having one-time visitors and repeat customers.


Subscribe to our newsletter:

Your Email address:

  

Privacy Policy: Your e-mail address will never be sold, rented or given away to anybody. You can unsubscribe at any time.