Other Elements: Surveys, Forms & Sounds
HTML is typically much more advanced than people give it credit for. While advanced programming languages reap the rewards for being complex in nature, or incorporating several built-in functions, HTML provides the basis for much of the interactivity on the web.
We're going to look at a few of the elements that you'll have the opportunity to work with as you grow accustomed to HTML coding. These include forms, sounds and the implementation of web surveys.
It goes without saying that you can build a successful website without these elements; although forms are extremely popular; but you'll soon find that they can add an extra dimension to your site.
Sound, for example, is a great way of bringing your page to life and providing a further level of multimedia which was simply out of the equation during the early days of the Internet.
It's now possible to embed music in to a page so that the user hears a certain song when they browse it. The trend has been accentuated largely by the role of user generated content sites such as MySpace and Bebo. Years ago, the most you could expect was a MIDI file to play over the background, which at the time, was nice, but ultimately no more than computerized bleeps. With increasing bandwidth, a sizeable number of web users are capable of streaming audio content and this is possible through basic HTML programming.
Looking past the usage of MP3 and WMA to stream modern music, you need to consider that not every computer is capable of supporting sound. Maybe the user doesn't have a sound card, or maybe their speakers are switched off. Either way, you shouldn't assume that a web user is going to be able to hear audio.
WAVE (Waveform Audio File Format), MIDI (Musical Instrument Digital Interface) and Microsoft's AU format are the most common that you'll find for simple web sound. They're also the most highly supported and thus significantly more likely to play on a standard platform.
To include an audio file in your web page, you will need to use one of the following code examples: - <EMBED src="yourfile.mid" WIDTH=200 HEIGHT=150 AUTOSTART="false">
In the instance above, the file will be embedded in to the page and the user will be able to click a small icon to play the music. This is the way that we transfer videos and audio files on user generated content communities. Embedding the multimedia file in to the page allows it to be played on any website. It's extremely recommended that you set the AUTOSTART attribute to FALSE. This prevents the file from playing automatically, and is widely considered the polite thing to do. Users should have the choice as to whether they want to have your audio files blasted through their speakers.
- <A href="mysong.wav">Click To Hear My Song</A>
This second example shows how you can provide a link to an audio file, without embedding unexpected music in to the actual page. When the user clicks the link, they'll be given the chance to listen to the audio file. The only problem with this method is that it raises copyright issues if the user should decide to actually save the file to their hard drive, which is harder to do with an embedded clip.
Unlike other forms of media such as images, the use of audio files has been somewhat slow in catching on. But it looks as if web users are finally accepting it and in certain circumstances "where you're not intruding on the user" a small HTML code snippet can add a whole new level of interactivity to your website. But it doesn't stop there.
As one of the most essential components on the web, forms can be used to provide direct interactivity with your website traffic. It cannot be understated how influential forms are in the global scheme of running a website. But what are they?
Without them, the web would be strictly read-only. By submitting forms to a web server, through a CGI interface, we can allow users to interact with the previously static content on our pages. How else would we retrieve information from the user?
Whenever you register on a website, login or submit any kind of change: you're using a form. Below is the basic syntax of a standard HTML form declaration.
- <FORM ACTION="action_page.extension" METHOD="get/post"> </FORM>
Bare in mind that this is no more than the basic syntax and we would typically go on to declare several text boxes or select fields to give the form a purpose. But let's look at the basics.
The ACTION attribute is what we use to define where the form should be sent when the user presses the submit button. Some forms will send data to the same page, others will redirect.
The METHOD attribute can be either GET or POST. The difference is subtle but important. When we use the GET attribute, form data is submitted through the URL string "that's the address bar" and visible to the trained eye. The POST method is different in the sense that it submits data as part of the actual body of the form. By doing this, we can count on additional security and the data will not be visible in the URL string. But we also lose the ability to bookmark or save a page URL.
Inside the opening and closing form tags, we can use a variety of different input tools to specify the type of data that will be submitted, and also the presentation. These include:
- Text fields
- Password fields
- Select boxes
- Radio buttons
- Upload options
- Text areas
- Generic buttons
By using forms, there's plenty of opportunity to retrieve feedback from web visitors, and we can implement a survey to do just this.
Web surveys are great for collecting information straight from the audience that you're pitching your website at. Not to mention, users like to feel that their opinion counts and it should!
Software is available to install a survey system and save yourself a lot of time, but if you have a firm grasp of forms, including knowledge of CGI, Perl or even ColdFusion , you can write your own code and have users' opinions collected almost straight away.
Every commercial website should have a "How can we improve?" dialogue form somewhere, just as long as it isn't the first thing the user notices when loading the page! A survey can be as minimal or as extensive as you want it to be, but there's no doubt that HTML is capable of initiating the task, even if a server-side scripting language is required to finish the job.
Designing a website doesn't have to be a chore of static content creation and minimal interactivity. Indeed, most of the top websites are finding creative new ways to relate to their audience, and by making use of these additional elements, you can too!-------------------------------------------------------------------------------------------------------If you are a business owner get listed at Best Technology Site, part of Localwin Network.