Link button

J

Jim S

I am sure I have seen the reason for this somewhere, but if so I have
forgotten, so bear with me.
In my website I choose to link pages with 'moving' buttons.
Up until now and with help here I have used a stylesheet (in the example I
have put it on the page, but usually it is elsewhere)

Below the button I have added a button as a form input. It works well
enough and needs no CSS. I realize that there really is no form, but apart
from that is the top one 'better' and if so why?

I am aware that the recipient needs to have javascript enabled.

The test page is http://www.jimscot.myby.co.uk/Button_tester_1.html
 
J

Johannes Hafner

Jim said:
I am sure I have seen the reason for this somewhere, but if so I have
forgotten, so bear with me.
In my website I choose to link pages with 'moving' buttons.
Up until now and with help here I have used a stylesheet (in the example I
have put it on the page, but usually it is elsewhere)

Below the button I have added a button as a form input. It works well
enough and needs no CSS. I realize that there really is no form, but apart
from that is the top one 'better' and if so why?

I am aware that the recipient needs to have javascript enabled.

The test page is http://www.jimscot.myby.co.uk/Button_tester_1.html

Yout JS does nothing in Firefox. Clicking the button does what it's
supposed to do, but without any JS working: it takes me to where the
href-attribute of the a-element around the input points.

Why do you use Javascript? What about
| <form action="..."><input type="submit" value="TEXT"></form>
that would at least be a valid form.

Even better would be the following solution (also not valid HTML 4.01
Strict):
| <a href="..."><button>TEXT</button></a>

But the best solution is the one you mentioned yourself: take a <a> and
format it using CSS. Why is this better? Becaus it's valid (means
syntactivcally correct) and semantical correct (means you use a <a> as
link as it's specified and not an element which originally had a
different meaning just because it looks like you want it to).

Johannes
 
J

Jim S

Yout JS does nothing in Firefox. Clicking the button does what it's
supposed to do, but without any JS working: it takes me to where the
href-attribute of the a-element around the input points.

Why do you use Javascript? What about
| <form action="..."><input type="submit" value="TEXT"></form>
that would at least be a valid form.

Even better would be the following solution (also not valid HTML 4.01
Strict):
| <a href="..."><button>TEXT</button></a>

But the best solution is the one you mentioned yourself: take a <a> and
format it using CSS. Why is this better? Becaus it's valid (means
syntactivcally correct) and semantical correct (means you use a <a> as
link as it's specified and not an element which originally had a
different meaning just because it looks like you want it to).

Johannes

Thanks Johannes
I've changed the second one to your first suggestion and it now validates
OK.
Now I really cannot see why it is wrong (or less correct than the first CSS
button)
 
R

Raymond Schmit

Thanks Johannes
I've changed the second one to your first suggestion and it now validates
OK.
Now I really cannot see why it is wrong (or less correct than the first CSS
button)

All goes well with SeaMonkey.
Just to mention that using the second buton tells me that the
information i will send over the internet is not encrypted - seems
normal, because there is a form.
The first button method is enough to perform the page switch.

What's the problem ?
 
J

Jim S

All goes well with SeaMonkey.
Just to mention that using the second buton tells me that the
information i will send over the internet is not encrypted - seems
normal, because there is a form.
The first button method is enough to perform the page switch.

What's the problem ?

No problem.
I'm a 'tweaker' with lots of time on my hands, but limited programming
skills and just fancied a change. However I like to sus things out before
finding afterwards that I have done something that I may regret.

The second (form method) looks more like the buttons you find in windows
applications ... sort of 'professional' I suppose.
My CSS version looks - well less 'slick'

I can accept "You cannot do that because it will all go pear shaped", but
"that's bad form old chap" cuts no ice.
 

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

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top