Using <form> as link

J

Jim Scott

I have successfully work out how to use a 'form' button as a link. I was
quite pleased as it is only two lines and works well.
EXCEPT when the URL is a long complicated string such as a multimap
address. Then I have to go back to a different method of using a 'form'
which is not standards compliant.
Both types appear on this page
http://freespace.virgin.net/mr.jimscott/bells/Bell_Menu.html
(the map ones are the ones that are not validatable, the others are ok)
Any ideas?
 
D

David Dorward

Jim said:
I have successfully work out how to use a 'form' button as a link. I was
quite pleased as it is only two lines and works well.

Its as many lines as you make it ...

<form
action="foo"
method="get">
<div>
<input
type="submit">
</div>
</form>

Look! I can do it on 8! ;)

Its very ugly though. Far better to use real link. You can then style it to
look like a button, or better yet - not. Users expect buttons to do things.
Users expect links to go to set places. Its not very nice to confuse them
(lots of users are very easily confused).
EXCEPT when the URL is a long complicated string such as a multimap
address. Then I have to go back to a different method of using a 'form'
which is not standards compliant.

No you don't.
Both types appear on this page
http://freespace.virgin.net/mr.jimscott/bells/Bell_Menu.html
(the map ones are the ones that are not validatable, the others are ok)
Any ideas?

* Use real links
* Don't depend on JavaScript
* Read the FAQ about ampersands in URLs (the one that the validator links to
in its error message about them!).
 
J

Jim Scott

Its as many lines as you make it ...

<form
action="foo"
method="get">
<div>
<input
type="submit">
</div>
</form>

Look! I can do it on 8! ;)

Its very ugly though. Far better to use real link. You can then style it to
look like a button, or better yet - not. Users expect buttons to do things.
Users expect links to go to set places. Its not very nice to confuse them
(lots of users are very easily confused).


No you don't.


* Use real links
* Don't depend on JavaScript
* Read the FAQ about ampersands in URLs (the one that the validator links to
in its error message about them!).

Thank you.
I found your reply sarcastic and patronising in the extreme and as a
relative newbie I found most of what you said beyond comprehension. I have
a degree in physics and in maths, but came to html late in life.
I presume by 'real link' that you mean a line of text which redirects the
user to the page in question.
I wish to use a labelled button that appears to move, and the 'form' method
I stumbled upon avoids me making lots of 'up' and 'down' buttons for this
purpose.
 
T

Toby Inkster

Jim said:
EXCEPT when the URL is a long complicated string such as a multimap
address. Then I have to go back to a different method of using a 'form'
which is not standards compliant.

You are using (hastily line wrapped):

<form><input style="width: 100px;" name="area map"
value="AREA MAP"
onclick="window.location='http://www.multimap.com/map/browse.cgi?
client=public&X=435000&Y=567500&width=500&height=300&gride=435393
&gridn=568683&srec=0&coordsys=gb&db=pc&addr1=&addr2=&addr3=&pc=
NE290LW&advanced=&local=&localinfosel=&kw=&inmap=&table=&ovtype=
&zm=0&scale=50000&out.x=4&out.y=8'"
type="button"><br>
</form>

Try:

<form action="http://www.multimap.com/map/browse.cgi" method="get">
<div>
<input type="hidden" name="client" value="public">
<input type="hidden" name="X" value="435000">
<input type="hidden" name="Y" value="567500">
<input type="hidden" name="width" value="500">
<input type="hidden" name="height" value="300">
<input type="hidden" name="gride" value="453393">
<input type="hidden" name="gridn" value="568683">
<input type="hidden" name="srec" value="0">
<input type="hidden" name="coordsys" value="gb">
<input type="hidden" name="db" value="pc">
<input type="hidden" name="pc" value="NE290LW">
<input type="hidden" name="zm" value="0">
<input type="hidden" name="scale" value="50000">
<input type="hidden" name="out.x" value="4">
<input type="hidden" name="out.y" value="8">
<input type="submit" value="AREA MAP">
</div>
</form>
 
J

Jim Scott

You are using (hastily line wrapped):

<form><input style="width: 100px;" name="area map"
value="AREA MAP"
onclick="window.location='http://www.multimap.com/map/browse.cgi?
client=public&X=435000&Y=567500&width=500&height=300&gride=435393
&gridn=568683&srec=0&coordsys=gb&db=pc&addr1=&addr2=&addr3=&pc=
NE290LW&advanced=&local=&localinfosel=&kw=&inmap=&table=&ovtype=
&zm=0&scale=50000&out.x=4&out.y=8'"
type="button"><br>
</form>

Try:

<form action="http://www.multimap.com/map/browse.cgi" method="get">
<div>
<input type="hidden" name="client" value="public">
<input type="hidden" name="X" value="435000">
<input type="hidden" name="Y" value="567500">
<input type="hidden" name="width" value="500">
<input type="hidden" name="height" value="300">
<input type="hidden" name="gride" value="453393">
<input type="hidden" name="gridn" value="568683">
<input type="hidden" name="srec" value="0">
<input type="hidden" name="coordsys" value="gb">
<input type="hidden" name="db" value="pc">
<input type="hidden" name="pc" value="NE290LW">
<input type="hidden" name="zm" value="0">
<input type="hidden" name="scale" value="50000">
<input type="hidden" name="out.x" value="4">
<input type="hidden" name="out.y" value="8">
<input type="submit" value="AREA MAP">
</div>
</form>

Thanks Toby.
 
T

Travis Newbury

Jim said:
I have successfully work out how to use a 'form' button as a link. I was
quite pleased as it is only two lines and works well.
EXCEPT when the URL is a long complicated string such as a multimap
address. Then I have to go back to a different method of using a 'form'
which is not standards compliant.
Both types appear on this page
http://freespace.virgin.net/mr.jimscott/bells/Bell_Menu.html
(the map ones are the ones that are not validatable, the others are ok)
Any ideas?

Man, Multi map really blows doesn't it? I mean their website not the
link crap.

Now for your issue, why not just use a link?
 
T

Travis Newbury

Jim said:
Thank you.
I found your reply sarcastic and patronising in the extreme and as a
relative newbie I found most of what you said beyond comprehension. I have
a degree in physics and in maths, but came to html late in life.

Which is why you need to do What David suggested. He has been doing
this for a long long time.
I presume by 'real link' that you mean a line of text which redirects the
user to the page in question.

Yes that is what he probably means.
I wish to use a labelled button that appears to move, and the 'form' method
I stumbled upon avoids me making lots of 'up' and 'down' buttons for this
purpose.

Huh? Use a link. you will be happier, as will your visitors
 
D

...D.

Jim Scott said:
Thank you.
I found your reply sarcastic and patronising in the extreme and as a
relative newbie I found most of what you said beyond comprehension. I have
a degree in physics and in maths, but came to html late in life.
I presume by 'real link' that you mean a line of text which redirects the
user to the page in question.
I wish to use a labelled button that appears to move, and the 'form' method
I stumbled upon avoids me making lots of 'up' and 'down' buttons for this
purpose.

Jim.. it's just like that here in this HTML group.. There's like a "club"
of several "pros".. In fact your lucky you got some costrutive critssm in
the reply, not just a: come back when you know 1/2 of what we know, and
maybe we'll help you without just pointing you at something with links..

There re some good people here though, I'm not talking everybody. .

...D.
 
J

Jim Scott

Jim.. it's just like that here in this HTML group.. There's like a "club"
of several "pros".. In fact your lucky you got some costrutive critssm in
the reply, not just a: come back when you know 1/2 of what we know, and
maybe we'll help you without just pointing you at something with links..

There re some good people here though, I'm not talking everybody. .

...D.

Thanks I am off to try Toby's button.
 
T

Toby Inkster

Jim said:
I wish I had found it before changed most of my web pages (lots and lots).
What I want now is a means of adding the text/css to the headers on all my
pages (lots and lots and lots) without opening them all individually :eek:)

If you're using the same visual effect on a bunch of pages, use an
external style sheet.

Example: http://tobyinkster.co.uk/
 
J

Jim Scott

If you're using the same visual effect on a bunch of pages, use an
external style sheet.

Example: http://tobyinkster.co.uk/

Thanks Toby I'll bookmark that. I actually tried that and of course it
works, but it would take me hours to go back and start again.
In the meanwhile I like the look and feel of the <form> button (and if it's
ugly html, the result looks pretty, which is what I'm after).
The alternative method of getting over the ampersand problem also worked
although you transposed two numbers and put my church in the North Sea :eek:)
I converted the other one too.
Right at the mo' WC3 is telling me I have a stray <input> error somewhere
on that page so I'm off to look for it.
Ta!
 
B

Blinky the Shark

D said:
Jim.. it's just like that here in this HTML group.. There's like a "club"
of several "pros".. In fact your lucky you got some costrutive critssm in

Is critssm anything like floatsam and jetsam?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top