0
alert();  // this alert appears for Firefox too.
$('<form action="Order/Create" id="Formabc" method="POST">' +
            '<input type="hidden" name="WeightUnit" value="' + Units + '">' +
            '<input type="hidden" name="Premium" value="' + 'N/A' + '">' +
            '<input type="hidden" name="Cost" value="' + Cost + '">' +
            '</form>').submit();

I am posting this form on jQuery Modal Model submit.

It is working in Chrome, Safari and IE, but not in Firefox..

Community
  • 1
  • 1
user79808
  • 77
  • 1
  • 9

1 Answers1

1

As MasterAM suggested, using ajax would be a better shout, but if you can't for what ever reason, append that form to the DOM and fire it then.

$('body').append('<form action="Order/Create" id="Formabc" method="POST">' +
            '<input type="hidden" name="WeightUnit" value="' + Units + '">' +
            '<input type="hidden" name="Premium" value="' + 'N/A' + '">' +
            '<input type="hidden" name="Cost" value="' + Cost + '">' +
            '</form>');


$('#Formabc').trigger('submit');

But ajax is still a better way to go.

http://api.jquery.com/jQuery.ajax/

lededje
  • 1,859
  • 1
  • 16
  • 25