Hosting Geared For
your CMSMS needs
Hosting Starting at $15
- • Hosted Mail
- • Personal Control Panel
- • CMSMS 1.8.1 tested
- • Lightly packed servers
- • Intrusion Detection
- • URL monitored
- • Custom solutions available
CP Blogs
jQuery and form submit in Chrome
Category:
jQuery, HTML, Browsers - Compatibilities and Inconsistencies, Intermediate, Coding
So you can't get jquery's $('form').submit(); to work in Chrome?
Ad Space
So you can't get jQuery's $('form').submit(); to work in Chrome?
It turns out that when you look that the form headers in the net the submit buttons value does not get pushed over. When you look at the other browsers, Internet Explore in fiddler and firebug in Firefox, you can see that the submit button values are sent in post.
The solution is to not submit the form but send a ajax post but not return false so that the page reloads with the post response. Simple..
$('#CsearchSubmit').click(function() {
if($("#CsearchName").val()=='Search by Name:'){
$("#CsearchName").val('');
}
var Cname=$("#CsearchName").val();
//$("#imgoptionprimer").remove();
// alert('Handler for .submit() called.'+Cname);
$.post("/company/company-search.html", $("#cd_searchform form").serialize());
// $('#cd_searchform form').submit();
});
That is an example of the script that worked in everything but chrome till the $.submit() alternative. The replaced script is using $.post()
Hope that helps.. Cheers -Jeremy

Get Social With It
[+]Add A Comment
[+]