Submitting Forms with Links

mirror of /submit.asp

Accessible scripting index | tom.me.uk home

Forms have been around for years. They are a great way of getting information from the user, and sending it to the server. But recently web developers have got into the nasty habit of using script functions to submit forms - and not providing a simple submit button alternative.

The Problem

Using links just to submit a form is a very poor usage of them (see misusing links), such as:

<a href="javascript:document.formName.submit();">Submit Form</a>

or

<a href="#" onclick="document.formName.submit();">Submit Form</a>

The Solution

There are several solutions to this one, some easier than others...