I have a frame. I am creating a new form object in javascript. I have set action attribute to "TestMyPage.ashx" During runtime, FireFox converts action attribute to full url containing protocol, host name, virtual dir. name and page name. e.g.: "http://localhost:4768/MyApp/TestMyPage.ashx" It is expected that FireFox should load the url in action attribute on submit when it have the full url. But when I add the form object to frame, it converts the action attribute to "TestMyPage.ashx". I don't know what is causing this. Because action attribute now has page name only, it can not load the page (it do not have full url now). Code for FireFox:
this.innerDocument = document.getElementById('MYFRAME').contentWindow.document;
var \_form = document.createElement('form');
\_form.id = 'MYFORM';
\_form.name = 'MYFORM';
\_form.method = 'post';
\_form.enctype = 'multipart/form-data';
\_form.action = 'TestMyPage.ashx'; //Here, at runtime, action attribute gives full url.
this.innerDocument.body.appendChild(\_form); //Here, at runtime, full url in action
attribute is converted to page name only ...?.
When this is done for IE, during runtime it shows full url in action attribute, so it loads the page successfully. But FireFox is converting url to page name in action attribute. Code for IE:
var \_form = this.innerDocument.createElement('<form id = "MYFORM"
method="post" enctype="multipart/form-data" action="ImportHandler.ashx" />');
var formHTML = _form.outerHTML;
document.getElementById('MYFRAME').contentWindow.document.body.innerHTML = formHTML;
Can anybody suggest what is the problem for such behavior. Any guesses are welcome. Thank you.
Ashish Software Engineer, Pune