Hi, without using JavaScript, is it possible to submit a form, using a text link? – using a similar technique to that used in checking if a submit button has been clicked.
@ayveghJun 16.2008 — #You need JavaScript if you are to do that, and I'd advise against it.[/QUOTE] Why would you advise against submitting by activating the form via JS?
@SyCoJun 17.2008 — #Why would you advise against submitting by activating the form via JS?[/QUOTE]
If a user turns javascript off or is using a browser that isn't javascript enabled, how is the form submitted? Personally I think if people are so paranoid they turn off javascript, then they should use Linux! Still if it can be accommodated without degrading other users experiences then they ought to be.
You can use CSS to style a button to look like a text link, then it's the best of both worlds.
Incidentally if you use [code=html]<form cation="scrip.php" method="post"> <input type="hidden" name="submit" value="1"> <input type="submit" value="Submit me"> </form>[/code] Instead of naming the submit button you can submit the form using the return key even if there are multiple form on the same page. Whichever form was last focused will submit.
You then if() for the hidden value (which of course can be anything)
@ayveghJun 17.2008 — #I see - good point, although from the visitor tracking software I run on my sites, I can see that those who do turn it off are the minority.
As far as looking for a hidden value, I use those when I need to known whether the form was submitted or not.
For example, if I have script.php?do=login, the hidden value will allow me to know if the user submitted or not, without having to check each field to see if one of them has a value.