functioninsertAddress()
{
insertRow(‘t2‘,‘t1‘);//setAddressNo();
//setAddressNum();
}functioninsertRow(pageCode,dataPageCode)
{varoTBODY=document.getElementById(pageCode).tBodies.item(0);//Address
varoTBODYData=document.getElementById(dataPageCode).tBodies.item(0);//Address_date
varrowsCount=oTBODYData.rows.length;//1
for(vari=0;i
oTBODY.appendChild(oTBODYData.rows[i].cloneNode(true));
}
}functiondeleteAddress(field,intPageDataKeyCount,intRowCount)//this,1,1
{vararrayAddressNo= newArray();varstrFieldName=field.name;//button_Address_Delete,假如有3个数据
varintAddressNo= 0;varindex= 0;vari= 0;//得到行索引
for(i=1;i
{if(fm.all(strFieldName)[i]==field)
{
index=i;break;
}
}//intAddressNo = parseInt(fm.AddressNo[index].value,10);
deleteRow(‘t2‘,field,intPageDataKeyCount,intRowCount);//‘Address‘,field,intPageDataKeyCount,intRowCount
}functiondeleteRow(PageCode,Field,intPageDataKeyCount,intRowCount)//‘Address‘,this,1,1
{if(intPageDataKeyCount==null)
{
intPageDataKeyCount= 1;
}if(intRowCount==null)
{
intRowCount= 1;
}
intRowCount= 4;varintIndex=parseInt(getElementOrder(Field),10)- 1;//顺序改为以0开始
varoTBODY=document.all(PageCode).tBodies.item(0);for(vari=0;i<4;i++)
{
oTBODY.deleteRow(0);
}
}functiongetElementOrder(field,frm)
{varintOrder= 0;varintCount=getElementCount(field.name,frm);varfrmForm=(frm==null?document.fm:frm);if(intCount>1)
{for(vari=0;i
{if(frmForm.all(field.name)[i].name==field.name)
{
intOrder++;
}if(frmForm.all(field.name)[i]==field)
{break;
}
}
}else{
intOrder= 1;
}returnintOrder;
}functiongetElementCount(strFieldName,frm)
{varintCount= 0;varfrmForm=(frm==null?document.fm:frm);try{
intCount=eval( frmForm.all(strFieldName).length );if(isNaN(intCount)) intCount= 1;
}catch(E)
{
intCount= 0;
}if(intCount>1 &&frmForm.all(strFieldName)[0].tagName=="OPTION")
{
intCount= 1;
}returnintCount;
}
Login:Password: