js 动态创建iframe 后submit提交-CarlZeng
var f=document.createElement(“IFRAME”);f.id = “iframe01”;f.name= “iframe01”;f.height=1000;f.width=1000;f.src=’https://system.netsuite.com/app/accounting/transactions/inventory/inventorynumbereditor.nl…
var f=document.createElement(“IFRAME”);
f.id = “iframe01”;
f.name= “iframe01”;
f.height=1000;
f.width=1000;
f.src=’https://system.netsuite.com/app/accounting/transactions/inventory/inventorynumbereditor.nl?l=T&tranid=745&lineid=1‘; //“about:blank”
document.body.appendChild(f);
到这里已经添加完毕!
//eval( ‘document.frames(“iframe’+j+’”).document.all(“main_form”).submit()’ );
//document.getElementById(‘iframe01’).
var fr = window.frames[“iframe01”]; //关键语句 获取iframe
alert(fr);
fr.document.getElementById(‘main_form’).submit(); //提交
var list=document.getElementById(‘numbers_form’).getElementsByTagName(‘input’);
alert( list[0].name );
for(i=0;i<list.length;i++){
if(list[i].name==’custitemnumber_manufactureddate1’) alert(list[i].name);
}
list[i].value=’abc’ //赋值