2013年8月13日 星期二

javascript-combo

/* FunctionName RandoM PhpFile
RowSource e.g. STATUS2
ControlSource e.g. INVBODY_uom
Len e.g. 13
ConstraiN e.g. MODULE-UOM*/
function FunctionName()
{
if (window.XMLHttpRequest) {
xmlHttpRandoM = new XMLHttpRequest();
}else if (window.ActiveXObject) {
xmlHttpRandoM = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlHttpRandoM.open('GET','PhpFile?get_ConstraiN&callfunction=FunctionName',true);
xmlHttpRandoM.onreadystatechange=function()
{
if (xmlHttpRandoM.readyState==4)
{
if (xmlHttpRandoM.status == 200)
{
var status_cur = xmlHttpRandoM.responseXML;
var obj_field=document.getElementById('ControlSource');
var return_data='';
var s = xmlHttpRandoM.responseXML;
var _reccount = s.getElementsByTagName("reccount")[0].childNodes[0].nodeValue ;
for (iix=0; iix<_reccount; iix++) {return_data=s.getElementsByTagName('RowSource')[iix].childNodes[0].nodeValue ;
var option = new Option(return_data,return_data);
try { obj_field.add(option,null); } catch(ex) {obj_field.add(option);} ;
FunctionName_array[iix]=return_data;
if (temp0218) {
strend=temp0218.indexOf("</ControlSource>");
strbegin=temp0218.indexOf("<ControlSource>")+Len*1;
_refresh('ControlSource' ,_round(temp0218.substr(strbegin,strend-strbegin),"0"));
}
}
}
}
};
xmlHttpRandoM.send(null);
}/*2011111219*/

沒有留言:

張貼留言