//页面显示出来了,下面的任务就是对它们进行操作了。以下都是前台javascript函数。第一步,首先在window.onload事件中根据数组aCategory来生成选择框selCategory的option值。
function On_Load()
{
//初始化
frmManager.btnChangeMaster .disabled = true ;
frmManager.btnChangeName .disabled = true ;
frmManager.btnDeleteCategory .disabled = true ;
frmManager.btnDown .disabled = true ;
frmManager.btnModifyDescription .disabled = true ;
frmManager.btnUp .disabled = true ;
frmManager.btnAddForum .disabled = true ;
frmManager.btnDeleteForum .disabled = true ;
//首先生成selCategory的option
frmManager.selCategoryName.options.length = 0;
for (var i = 0 ; i < aCategory.length ; i++)
{
var newOption = document.createElement("OPTION") ;
newOption.value = aCategory[i].CategoryID ;
newOption.text = aCategory[i].CategoryName;
frmManager.selCategoryName .add (newOption , i) ;
}
}
//第二步,我们利用selCategory的onchange事件来实现selForum的显示,利用selForm的onchange事件来实现它们相关信息的显示。
function On_CategoryChange()
{
frmManager.btnChangeName .disabled = false ;
frmManager.btnDeleteCategory .disabled = false ;
frmManager.btnDown .disabled = false ;
frmManager.btnUp .disabled = false ;
frmManager.btnAddForum .disabled = false ;
frmManager.btnModifyDescription .disabled = true ;
frmManager.btnChangeMaster .disabled = true ;
frmManager.btnAddCategory .disabled = false ;
frmManager.btnDeleteForum .disable