I think galt is saying:
<form method="GET" action="http://www.foo.com/spa">
<input type="submit" value="go">
</form>
At least, I hope that is what he is saying, because it works.
I think galt is saying:
<form method="GET" action="http://www.foo.com/spa">
<input type="submit" value="go">
</form>
At least, I hope that is what he is saying, because it works.
erislover, now I see what he was referring to exactly. Although that does work, it appears that some browsers append a question mark to the URL after the button is clicked. Usually not a problem, I suppose.
Strange how the KISS Principle seems to be forgotten here.
Sure one can use a FORM to create an ordinary link. But why do it? Just because you can? If anything, this smacks more of ego wanking than quality, tight code. Code bloat is a serious problem in and of itself. So why contribute to it, even on such a small scale? Seems to me if you are going to create extra work for yourself in one area, you will probably do it in other areas of the site, too.
In addition, you also raise a red flag for intelligent surfers who see a FORM action (the submit button) without any actual form fill-in-the-blanks. For me, I would be viewing the source code to see if I’m about to send hidden data someplace without my knowledge or permission.
I already answered that.
This is not an issue of “code bloat” or “tight code” (the code in the browser to handle form submissions is certainly at least as efficient as the code to start up a javascript interpreter for a single frickin’ assignment statement), and for your information, when the original requirement is “how do I use a button like a link on an html page” then it’s eminently appropriate to use a form. You want to fake it with something that looks like a button but isn’t? Fine, but don’t be surprised when your buttons look and act funny under certain circumstances, confusing the user.
In addition, intelligent surfers know that it doesn’t take a visible form button to submit a form, so whether or not what you’re clicking on is obviously a button, hidden fields may exist. Buttons don’t indicate form data is being sent, and the lack of buttons doesn’t indicate that it’s not. behold
And finally, using javascript and/or CGI when it’s not necessary is hardly the KISS principle. Sometimes when someone asks “how do I do X?” the simplest answer is “like this”, not “well here’s a way to do something that kind of looks like X but forces you to learn a new technology and/or just copy and paste without understanding it.”
Wow, this thread got fucking preachy.
There are many ways to make link buttons. We listed them. Let Fenris decide what he wants.
grumble. tell that to the guy throwing around terms like “code bloat” and “ego wanking” while providing wrong answers.
I was