MB620 Bioinformatics
University of New Haven
Instructor: Joel S. Bader
Class 4: HTML Forms


Agenda


Homework Comments

The homework due last week was to perform analyses using a bioinformatics server (CuraTools).
Database searches for bioinformatics are like database searches for other info.
What do you do when a query returns too many results?
For future assignments, only keep information that you would reasonably use.

Forms, Part 1: URL input

Forms are used to provide input to server-side programs.
The simplest way to provide input is to pass it through the URL.
Think of a query you run often, save the URL, then make it an HREF
The format looks like this:
http://server/program?param1=value1&param2=value2
This type of URL is often the result of a GET form.
Add a URL query to your homepage. Here's an example.

Now use the URL as the HREF for a link and call on Nasdaq to generate a stock quote:
Amazon stock quote

Odds and Ends: Pop-Up Windows

What if you want to keep your window and pop-up a new window?
The A tag can take a TARGET attribute:
<A HREF="http://www.yahoo.com/" TARGET="new_window">Yahoo</A>
loads Yahoo in a new window named "new_window"
Yahoo
What happens if you make "new_window" the target of another link?
How would you get more windows?

Odds and Ends: Special Characters

You know that < starts a tag and > ends a tag.
But what would happen if you had a < in your document?
How does the browser know what to do?

Common Codes

Changing fonts

Forms, Part 2: GET forms

As we've seen before, GET forms encode the user input as part of the URL
Here is an example from the search engine www.altavista.com
Go to altavista, view the page source, and copy the form into a web page.
Be careful: the form is contained in a table. We have to grab the table too.
Let's step through the form and see what each line does.
New tags:


Ask AltaVistaTM a question.  Or enter a few words in Help - Advanced
Example: What hotels are in Wilmington, DE?

It almost works, but not quite: we have to do some debugging!
Here's a working version that pops up the result in a new window:


Ask AltaVistaTM a question.  Or enter a few words in Help - Advanced
Example: What hotels are in Wilmington, DE?

What happens in the GET URL when the query has spaces, semicolons, etc.?

Odds and Ends: More Special Characters

We've seen these special characters:
: / // # .
What happens if you want a space in a URL? Or another special character?
Solution: hex-code. %20 is a space. Don't have to worry about remembering, but do be aware that complicated URLs with lots of % characters are just encoding special characters.

Forms, Part 3: POST

What happens when you're passing a lot of text as a query?
The URL can run out of room, special characters can become a bother, etc.
POST forms are written just like GET forms.
But when you submit with a POST form, the input goes directly to the server. It does not get tacked onto the URL, it does not collect $200.

Here is an example from the International Movie Database:

Search for title/name:
 Title   Name
more search options

That's all for forms for now.

Directories

Directories = folders
Organization
Typical directories

Making a new directory

If you point a web browser to this directory, what will you see and why?

Files

Make a link from one file to another file

Fancy Links

Order of fanciness: Making an icon link

Linking inside a document

Most useful: table of contents for a long document.
Example: link to separate parts of a tool list.
At top of document:

<A HREF="#education">Education</A>
<A HREF="#employment">Employment</A>
<A HREF="#references">References</A>
Then later in the document:
<H4> <A NAME="education">Education</A> </H4>
Spring 1999, University of New Haven, Bioinformatics (MB620)

Here is how it should look (and work!)

Education

Education

Spring 1999, University of New Haven, Bioinformatics (MB620)

Does it matter that the NAME parameter and the heading are similar?

How would you link directly from your homepage to the education section of your resume? Try it.
Note the hash-mark in the URL. This always indicates a

Linking between directories


Week 5 Homework


Copyright 1999 Joel S. Bader jsbader@curagen.com