html - Javascript form is not able to submit as expected on Internet explorer -



html - Javascript form is not able to submit as expected on Internet explorer -

i have function creates form in javascript , submits it. works expected in safari, chrome, ff, & opera not ie 10.

when submits browser not pointed url in action attribute in ie. i'm sure lame can't find problem help appreciated.

function checkout() { var mydoc = 'some xml info send' var form = document.createelement("form"); form.setattribute( "method", "post" ); form.setattribute( "action", "http://domain.com/script.php" ); var hiddenfield = document.createelement("input"); hiddenfield.setattribute( "type", "hidden" ); hiddenfield.setattribute( "name", "myfield" ); hiddenfield.setattribute( "value", mydoc ); form.appendchild(hiddenfield); form.submit(); }

thanks help!!!

you're creating form, you're not appending document.

add

document.documentelement.appendchild(form);

just before

form.submit();

javascript html internet-explorer internet-explorer-10

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -