Skip to content Skip to sidebar Skip to footer

Safari Does Not Trigger Form Submit

For a project I got two select-formfields that get sent via jquery trigger('submit'); This works well in Firefox und Chrome, but in Safari nothing happens. This is the HTML-Code:

Solution 1:

Using Safari version 11.1.2 (13605.3.8) on a desktop Mac: if target="_blank" is specified within a form tag, submitting the form fails. That same form works as expected on other browsers. Remove the target="_blank" specification and the form works properly. The same form with target="_blank" does work as expected on other browsers including Chrome, Firefox and IE.

I can only assume this failure to support the "target" attribute is a Safari defect. A possible work-around would be to use "javascript:window.open()" instead of the URL as the action.

Solution 2:

Try to use jQuery in place of $ ,

     jQuery("body").on("change", ".bstarch", function () {
      if (jQuery(this).val() != "none") {
       jQuery("#mmform").attr("action", $(this).val());
       jQuery("#mmform").trigger("submit");
       jQuery(this).val("none");
      }
    });

Post a Comment for "Safari Does Not Trigger Form Submit"