Trying to create and submit form within a javascript call. This code works fine on Chrome but doesn’t on Firefox and IE. I first get values from Ajax call (JSON) and then submit it as a form
$('<form name="acsform" action="' + JSONobject.formacsurl +'" method="POST">' +
'<input type="hidden" name="PaReq" value="' +JSONobject.formpareq + '">' +
'<input type="hidden" name="TermUrl" value="'+ JSONobject.formtermUrl +'">' +
'<input type="hidden" name="MD" value="'+ JSONobject.formmd +'">' +
'</form>').submit();
Any ideas?
Just to add… when I alert some text a line below that submission, I get the alert box on the screen. It may seem like browser goes through that code fine (perhaps even submits the form) but I’m not being redirected to forms action address. I don’t get any JS errors either.
Once again, it fails only on Firefox and IE, Chrome does submission plus redirection fine.
Try this code:
Bye!