wb.AddForm("", "form1", "aa.htm")
With wb.AddInputGroup("form1", "ipg1", "旅游")
.AddSelect("旅游", "", "是|否").A t tribute = "o n change='s e tjoin1()'"
End With
With wb.AddInputGroup("form1", "ipg2", "旅游地点")
.AddSelect("旅游地点", "", "步行|公交|火车").A t tribute = "o n change='setjoin2()'"
End With
With wb.AddInputGroup("form1", "ipg3", "交通方式")
.AddSelect("交通方式", "", "111|222|333").A t tribute = "o n change='setjoin10()'"
End With
With wb.AddButtonGroup("form1", "btg1", False)
.Add("btn1", "提交", "submit").Kind = 2
.Add("btn2", "返回", "", "***") '外部系统
End With
wb.AppendHTML("<script src='./lib/.js'></script>") '引入脚本文件
2.js代码如下所示:
f u nction s e tjoin1(){
var cj = document.getElementById("旅游").value;
if(cj=="是")
{
document.getElementById("ipg2").parentNode.style.display="inline";
document.getElementById("ipg3").parentNode.style.display="none";
document.getElementById("btg1").parentNode.style.display="none"; //按钮无法隐藏
}
else //否 - 不参加
{
document.getElementById("ipg2").parentNode.style.display="none";
document.getElementById("ipg3").parentNode.style.display="none";
document.getElementById("btg1").parentNode.style.display="none";
}
}