views:

72

answers:

1
   <form method="POST" action="auth/signin">
        Username: <input name="username" type="text" value=""/>
        Password: <input name="password" type="password" value=""/>
        <a href="auth/signin">Log In</a>
    </form>

How do I post the parameters when the "Log In" link is clicked (instead of using the submit button)?

+4  A: 

I think you need Javascript, something like this:

<a href="javascript:document.yourform.submit();">Log In</a>
Mark Byers
You need to specify which form to submit. So your code would work, if the form had the name "form". <form method="POST" name="form" ... >
Frederik Wordenskjold
Frederik, I just changed it to "yourform" to be more explicit, so the name of the form would have to be "yourform".
Mark Byers
Good work. I was thinking the same thing when I wrote the comment. Could easily be confusing with the name-clash.
Frederik Wordenskjold