form submit() function works for Mozilla but not IE?
My intent: override form's submit so I can make google search my choice of sites.
Problem: While this works fine in Mozilla, is doesn't work in IE (it's as if the 'action' I formed isn't even passed to the browser??)
Any ideas what will get this to work for IE? (I see that IE has a history of issues regarding form submit()... , and I have read advice that includes ensuring there is NO <input> named submit, etc.)
- <html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" ></script>
</head>
- <body>
- <script type="text/javascript">
$(function() {
// prepare the search form to search eBay sites via google
$("form#gsb").submit(function() {
var s1 = 'abc.com/';
var s2 = 'cbs.com/';
var s3 = 'nbc.com/';
var s4 = 'fox.com/';
- var action = 'https://www.google.com/#fp=1&q="' + $("input#gsbt").val() + '"' +
'+site:' + s1 + '+OR+site:' + s2 + '+OR+site:' + s3 + '+OR+site:' + s4;
alert("action: " + action);
- $(this).attr("action",action);
});
});
</script>
- <form id="gsb" method="get" action="https://www.google.com/#q=video">
<input id="gsbt" type="text" value="video"/>
</form>
- </body>
</html>
Thanks
oak island