<!-- #include file="../include/ASP_BEGIN.asp" -->
< html >
< body onload ="
<%if request(" id")< > "" then%>
doSelected(document.all.ddlRegion,' <% ... if not rsDPS.EOF then Response.Write rsDPS("REGION_ID") end if %> ',document.all.ddlZone,'PA_Ctrl_fillPS_AJAX.asp?handleType=bindDdlZone &Region = <% ... if not rsDPS.EOF then Response.Write rsDPS("REGION_ID") end if %> ');
doSelected(document.all.ddlZone,' <% ... if not rsDPS.EOF then Response.Write rsDPS("ZONE_ID") end if %> ',document.all.ddlProgramCode,'PA_Ctrl_fillPS_AJAX.asp?handleType=bindDdlProgramCode &Zone = <% ... if not rsDPS.EOF then Response.Write rsDPS("ZONE_ID") end if %> ');
doSelected(document.all.ddlProgramCode,' <% ... if not rsDPS.EOF then Response.Write rsDPS("PROGCODE") end if %> ',null,'');
doSelected(document.all.ddlZone,' <% ... if not rsDPS.EOF then Response.Write rsDPS("ZONE_ID") end if %> ',document.all.ddl_basecost,'PA_Ctrl_fillPS_AJAX.asp?handleType=bindBaseCost &ZONE_ID = <% ... if not rsDPS.EOF then Response.Write rsDPS("ZONE_ID") end if %> ');
doSelected(document.all.ddl_basecost,' <% ... if not rsDPS.EOF then Response.Write rsDPS("CostCenterNo") end if %> ',null,'');
chooseRegLN(document.all.ddlRegion.value);
chooseZonLN();
<% ... end if %>
">
< table cellpadding ="0" cellspacing ="0" border ="0" width ="100%" >
< tr valign ="top" >
< td id ="main" >
<!-- MAIN CONTENT BEGIN -->
<% ...
'Before Main Content ASP Begin
dim sql,rs
set rs = server.CreateObject("adodb.recordset")
sql = "select REG_ID,REG_Name,Leader_Name from dbo.PA_REGIONS"
rs.Open sql,connpa,1,1
'''''''''''''''''''''''''''''''''''''''''''
dim sql2,rs2
set rs2 = server.CreateObject("adodb.recordset")
sql2 = "select ZONE_Name,ZONE_ID,Leader_Name from dbo.PA_ZONES"
rs2.Open sql2,connpa,1,1
%>
< script src ="include/PA_fillrequestPS_Ajax.js" ></ script >
< script language ="javascript" > ...
var arrName = new Array();
arrName.push("");
var arrName2 = new Array();
var arrZoneID = new Array();
arrName2.push("");
arrZoneID.push("");
<%
while not rs2.EOF
%>
arrName2.push('<%=rs2("Leader_Name")%>');
arrZoneID.push('<%=rs2("ZONE_ID")%>');
// alert();
<%
rs2.MoveNext
wend
rs2.Close
set rs2 = nothing
%>
function chooseRegLN(index)
...{
document.all.RegLeadername.innerHTML = arrName[index]
}
function chooseZonLN()
...{
for(var i=0;i<arrZoneID.length;i++)...{
if(document.all.ddlZone.value==arrZoneID[i])...{
document.all.ZonLeadername.innerHTML = arrName2[i];
}
}
}
</ script >
< form id ="form1" name ="form1" method ="post" >
< table border ="0" width ="100%" class ="contentTable1" name ="DetailSS" >
< tr bgColor ="#f5f5f5" align ="left" >
< td width =8% colspan =2 > Region/Function < font color ="red" > * </ font ></ td >
< td width =8% colspan =2 >
< select id ="ddlRegion" name ="Region" onchange ="chooseRegLN(this.selectedIndex);
doSelect(this,document.all.ddlZone,url='PA_Ctrl_fillPS_AJAX.asp?handleType=bindDdlZone&Region='+document.all.ddlRegion.value);" >
<!-- document.all.ddlProgramCode.options.length=1;document.all.ddlProgramCode.options[0].selected = true; -->
< option value ="" > - Please Select - </ option >
<% ...
while not rs.EOF
Response.Write "<option value="&rs("REG_ID")&">"
Response.Write rs("REG_Name")
Response.Write "</option>"
%>
< script > ...
arrName.push('<%=rs("Leader_Name")%>');
</ script >
<% ...
rs.MoveNext
wend
rs.Close
set rs = nothing
%>
</ select >
</ td >
< td width =8% colspan =2 > Leader's Name < font color ="red" > * </ font ></ td >
< td width =8% colspan =2 >
< span id ="RegLeadername" ></ span >
</ td >
</ tr >
< tr bgColor ="#f5f5f5" align ="left" >
< td width =8% colspan =2 > Zone/Dapartment < font color ="red" > * </ font ></ td >
< td width =8% colspan =2 >
< select onchange ="chooseZonLN();doSelect(this,document.all.ddlProgramCode,url='PA_Ctrl_fillPS_AJAX.asp?handleType=bindDdlProgramCode&Zone='+document.all.ddlZone.value);
doSelect(this,document.all.ddl_basecost,url='PA_Ctrl_fillPS_AJAX.asp?handleType=bindBaseCost&ZONE_ID='+document.all.ddlZone.value);"
id ="ddlZone" name ="Zone" value ="<%=strZone%>" >
< option value ="--Please Select--" > --Please Select-- </ option >
</ select >
</ td >
< td width =8% colspan =2 > Leader's Name < font color ="red" > * </ font ></ td >
< td width =8% colspan =2 >< span id ="ZonLeadername" ></ span ></ td >
</ tr >
< tr bgColor ="#f5f5f5" align ="left" >
< td width =8% colspan =2 > Programe Code (If Base Cost) < font color ="red" > * </ font ></ td >
< td width =8% colspan =2 >
< select id ="ddlProgramCode" name ="ProgramCode" >
< option > - Please Select - </ option >
< option ></ option >
< option ></ option >
< option ></ option >
</ select >
</ td >
< td width =8% colspan =4 ></ td >
</ tr >
< tr bgColor ="#f5f5f5" align ="left" >
< td width =8% colspan =2 > Base Cost(Cost Center) < font color ="red" > * </ font ></ td >
< td width =8% colspan =7 >
< select name ="basecost" id ="ddl_basecost" style ="WIDTH: 130px" >
< option value = "--Please Select--" > --Please Select-- </ option >
</ select >
</ td >
</ tr >
</ table >
</ form >
</ div >
</ body >
</ html >