I have a simple form which can be submitted outside the element via a small jQuery Script.
<script type="text/javascript">
$(document).ready(function() {
$('#mybutton').click(function(){
$('#myform').attr('action', '/url/to/form').submit();
});
});
</script>
The button is just a normal link
<a href="javascript:void(0);" id="mybutton">Just a normal link</a>
The form is just a normal form
<form id="myform" action="/url/to/form">
....
<input type="submit" value="Search">
</form>
This works fine in IE, FF, Chrome, and Safari but not for Opera. In Opera it always redirects to my home page, not to the url of the form action. I have tried setting the action in the script (as above) and normally within the form action parameter but with no luck. I'm running that latest jQuery and Opera.
Please help
Edit: I'm also using the jQuery UI framework to handle some of the content and interactions
<button>
or an<input type="button">
; it's an anchor (an<a>
). – Wrac