I have been looking at this for hours. Here are the one i have looked at.
JQuery submit not working in Chrome
i also looked into the jquery submit
None of the solutions there are working for me.
Problem: I have a form that has a button that has a onclick that calls a javascript method. Then I have another form on the page (not in the other form outside it) that is a post form. In the javascript i call .submit() on that form. It works in Firefox, and IE, but not in Chrome, in chrome it reloads the page and keeps it on the same page. Firefox and IE open the new tab with the post page correctly. Here is the code:
<h:form id="mainForm>
...
<h:commandLink id="testUrlButtonPost" onclick="submitPage()"
styleClass="secondaryButton" value="#{__VendorAdmin.test}"/>
...
</h:form>
<script type="text/javascript">
function submitPage() {
var url = $('#addEditCatalogForm\\:baseURL').val();
document.getElementById("TestForm").action=url;
$('#TestForm').submit();
}
</script>
<form id="TestForm" name="TestForm" action="" method="post" target="_blank">
<ui:repeat value="#{vendorCatalogView.punchOutCatalog.urlParameters}" var="parameter">
<input type="hidden" name="#{parameter.name}" value = "#{parameter.value}"/>
</ui:repeat>
</form>
I have also tried:
- $('form#TestForm').submit()
- putting stuff in the submit so submit(function(event){...}); that one made it not work in any browser
- document.getElementById("TestForm).submit();
im using JSF and primefaces.
UPDATE:!!! So i noticed in the chrome inspect element tool this error:
net::ERR_INSECURE_RESPONSE I looked it up and it seems to deal with ssl certificates? but the problem is the site is a punch out catalog search that will have lots of links to external catalogs using post. So I can't just add the ssl certs manually nor would we want our customers to have to do this. Any work arounds?