⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 depart_onchange.vbs

📁 物业管理和办公自动化系统
💻 VBS
字号:
sub e_id_OnChange()
	dim iExchId, sPorts, arrayE, arrayPorts, arrayOpt, sOpt
	dim i
	sPorts = document.all.e_id.value

	if CStr(sPorts) = "0" then	'' 只有一个 “ 所有 ”
		sOpt = "<option value=""0"">-所有-</option>"
		document.all.exch_id.value = "0"
	else
		arrayE = Split(sPorts, ":")
		iExchId = arrayE(0)
		document.all.exch_id.value = iExchId
		'msgbox document.all.exch_id.value

		arrayPorts = Split(arrayE(1), "&")
		for i = LBound(arrayPorts) to UBound(arrayPorts)
			arrayOpt = Split(arrayPorts(i), "?")
			sOpt = sOpt & "<option value=""" & arrayOpt(0) & """>" & arrayOpt(1) & "</option>"
		next
	end if
	document.all.port_id.outerHTML = "<select name=""port_id"" style=""width:86px"">" & sOpt & "</select>"
	document.all.port_id.options(0).style.color = "black"
end sub


sub onload(port_id)
	''msgbox "port_id : " & port_id
	dim iExchId, sPorts, arrayE, arrayPorts, arrayOpt, sOpt, iPortId
	dim i
	sPorts = document.all.e_id.value
	''msgbox sPorts
	if CStr(sPorts) = "0" then	'' 只有一个 “ 所有 ”
		sOpt = "<option value=""0"">-所有-</option>"
		document.all.exch_id.value = "0"
	else
		arrayE = Split(sPorts, ":")
		iExchId = arrayE(0)
		document.all.exch_id.value = iExchId

		arrayPorts = Split(arrayE(1), "&")
		for i = LBound(arrayPorts) to UBound(arrayPorts)
			arrayOpt = Split(arrayPorts(i), "?")
			iPortId = arrayOpt(0)
			if LCase(CStr(iPortId)) = LCase(CStr(port_id)) then
				sOpt = sOpt & "<option value=""" & arrayOpt(0) & """ selected>" & arrayOpt(1) & "</option>"
			else
				sOpt = sOpt & "<option value=""" & arrayOpt(0) & """>" & arrayOpt(1) & "</option>"
			end if
		next
	end if
	document.all.port_id.outerHTML = "<select name=""port_id"" style=""width:86px"">" & sOpt & "</select>"
	document.all.port_id.options(0).style.color = "black"
end sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -