This may be a retarded question, but is there an elegant way to mimic the behavior of an anchor tag when submitting a form? I’d like my users to be able to hold down the control key while submitting a form and have the result open in a new window. Right now I’m using a funky, unreliable javascript workaround that I’m embarrassed to post here. Any help is appreciated.
Share
If you use jQuery, then you can do it like this. Let’s say that you have form
Bind a
keydownandkeyupevents to it like thisand then handle the click event on submit button
I hope that this works, cause I didn’t test it. 🙂