The Wayback Machine - https://web.archive.org/web/20081204103421/http://www.webreference.com:80/html/tutorial13/2.html


spacer

Webref WebRef   Sitemap · Experts · Tools · Services · Newsletters · About i.com

home / experts / html / tutorials / 13 / 2

index123456789101112131415161718192021exercises1

Tutorial 13: Giving Form to Forms

Developer News
Google Chrome Playing Catch-Up on Extensions
Open Solutions Alliance Gets New Leadership
Red Hat Spacewalk Expands Linux Management

The ISINDEX element

The first implementation of forms in HTML was through the ISINDEX element. Although almost all browsers in use today support this element, it is deprecated in HTML 4.0 and generally not very versatile or useful. In other words, it works, but don't use it.

The ISINDEX element

Context:
The ISINDEX element is a block element, but for compatibility reasons it can also be placed in the HEAD element. If this is done, it is rendered at the top of the page.
Contents:
This is an empty element.
Tags:
Empty element; start-tag is required, end-tag is forbidden.

Attributes for the ISINDEX element

prompt (text)
A prompt to display to the user when the element is rendered.
Identifier and classification attributes
Language information attributes
Title attribute
Inline style information attribute

The ISINDEX element offers a prompt (the default is usually something bland and boring like "This is a searchable index. Enter search keywords:") for the user to enter some text in. When the user presses Return or the text is submitted in some other way (this depends on the user agent; currently, all known user agents require you to press Return), a question mark (?) and the text that the user typed in is appended to the document's URI. Note that it is appended to the full document URI and not the base URI. In its simplest incarnation the ISINDEX element is used alone:

<ISINDEX>

This just creates a default text box. If you enter some text and press Return, you can see by looking at your browser's current location that the browser loads the current URI with the text appended. Since this page does not do anything special with this text, you just get the page again.

If this page was a telephone directory that could search for a name and produce the results, you should probably specify a more descriptive prompt, like this:

<ISINDEX PROMPT="Enter name (Last, First):">

Try entering your last name followed by a comma, a space, and then your first name, and look at the URI that is loaded by your browser. You'll notice that the comma has been replaced by %2C and the space by +. This is called URL-encoding, and I'll explain it more in the section on Form Encoding.

As I noted above, this page does nothing with the text you submit, as it would do nothing with more complex form data such as we will examine later on. This is the part I won't tell you about, because it has nothing to do with HTML. What you need is a program that runs on your Web server and handles this text, and does something useful with the data, like searching the telephone directory and returning any matches (It could do something not useful at all too. Usefullness is not strictly required by the specification. That was more of my idea. Neat, huh?). How you are going to do this depends on your server, and various technologies like CGI, ASP and others that don't even have a three-letter acronym can help you do this. The links above lead you to the appropriate links sections in Webreference.com. You can have a peek after you're done with the tutorial. You could look now, but I won't be very happy about it.

There is a bug in Navigator and Explorer when it comes to handling the ISINDEX element. When the document contains a BASE element specifying the base URI explicitly, the browser uses that URI for the form submission instead of the current directory. No way around this is currently known, so it's best to avoid the combination, and even better, use the FORM element instead (see later).

As I said before, the ISINDEX element is deprecated and, as you have seen, not very powerful. In general, you should never use it, as you can mimic its effects using the FORM element, which we will look at next. I just mention it here for historic purposes.

index123456789101112131415161718192021exercises1

Produced by Stephanos Piperoglou

internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and JupiterOnlineMedia

Jupitermedia Corporate Info

Copyright 2008 Jupitermedia Corporation All Rights Reserved.

Legal Notices, Licensing, Reprints, Permissions, Privacy Policy.
Advertise | Newsletters | Tech Jobs | Shopping | E-mail Offers

Whitepapers and eBooks

Symantec Whitepaper: Converging System and Data Protection for Complete Disaster Recovery
Intel Whitepaper: Comparing Two- and Four-Socket Platforms for Server Virtualization
IBM Solutions Brief: Go Green With IBM System xTM And Intel
HP eBook: Simplifying SQL Server Management
IBM Contest: Are You the Next Superstar? Join the "Search for the XML Superstar" Contest to Find Out
Intel PDF: Quad-Core Impacts More Than the Data Center
Intel PDF: Virtualization Delivers Data Center Efficiency
Go Parallel Article: PDC 2008 in Review
Avaya Article: Communication-Enabled Mashups: Empowering Both Business Owners and IT
Intel Whitepaper: Building a Real-World Model to Assess Virtualization Platforms
PDF: Intel Centrino Duo Processor Technology with Intel Core2 Duo Processor
  Microsoft Article: Build and Run Virtual Machines with Hyper-V Server 2008
Go Parallel Article: Q&A; with a TBB Junkie
IBM Whitepaper: Innovative Collaboration to Advance Your Business
Internet.com eBook: Real Life Rails
IBM eBook: The Pros and Cons of Outsourcing
Internet.com eBook: Best Practices for Developing a Web Site
IBM CXO Whitepaper: The 2008 Global CEO Study "The Enterprise of the Future"
Avaya Article: Call Control XML in Action - A CCXML Auto Attendant
IBM CXO Whitepaper: Unlocking the DNA of the Adaptable Workforce--The Global Human Capital Study 2008
Symantec Whitepaper: Comprehensive Backup and Recovery of VMware Virtual Infrastructure
MORE WHITEPAPERS, EBOOKS, AND ARTICLES
webref The latest from WebReference.com Browse >
Popular JavaScript Framework Libraries: An Overview - Part 3 · Accessing Your MySQL Database from the Web with PHP · Working with the DOM Stylesheets Collection
Sitemap · Experts · Tools · Services · Email a Colleague · Contact FREE Newsletters 
 The latest from internet.com
Review: Lenovo ThinkPad SL300 · OCZ PC3-10666 Gold 2x1GB Review · Apple Recommends Antivirus for Macs

URL: http://www.webreference.com/html/tutorial13/2.html

Created: May 28, 1998
Revised: February 25, 1999

Morty Proxy This is a proxified and sanitized view of the page, visit original site.