Client cgi--combining JavaScript and DHTML to realize BackOffice of BBS (II.)

Source: Internet
Author: User
Tags client
The cgi|dhtml| client//page is displayed, and the following task is to operate on them. The following are the foreground JavaScript functions. In the first step, the option value of the selection box Selcategory is generated first in the Window.onload event based on the array acategory.

function On_load ()
{

Class
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;

To first generate 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);
}

}

In the second step, we use the Selcategory onchange events to realize the Selforum display, and use the onchange events of Selform to realize the display of their relevant information.

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. Disabled = true;



frmManager.selForumName.options.length = 0;
if (frmmanager.selcategoryname. SelectedIndex!=-1)
{
FrmManager.txtCategoryName.value = Frmmanager.selcategoryname[frmmanager.selcategoryname.selectedindex].text;
}
FrmManager.txtForumName.value = ""
Frmmanager.txtdescription. Value = "&quo



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.