实现简单的二级联动
1、表单上创建一个组合框,ONCHANGE事件中写入如下代码:
var se=this.selectedIndex;
var xmlhttp_request = "";
xmlhttp_request=new ActiveXObject("Microsoft.XMLHTTP");
if (!xmlhttp_request){
xmlhttp_request=new ActiveXObject("MSXML2.XMLHTTP");
}
var url="fill?openagent&t="+this.options[se].text+"&id="+document.forms[0].CurDocId.value;
xmlhttp_request.open("GET",url,true);
xmlhttp_request.send(null);
xmlhttp_request.onreadystatechange=fill;
function fill(){
if (xmlhttp_request.readyState==4 && xmlhttp_request.status==200){
var xmldata=xmlhttp_request.responseXML;
var a=xmldata.documentElement.text;
document.forms[0].roomadmin.value=a;
document.forms[0].SendTo.value=a;
}
}
代理:
Sub Initialize
Dim s As New notessession
Dim db As notesdatabase
Dim view As notesview
Dim curdoc,doc As notesdocument
Set curdoc=s.documentcontext
Dim url,r As String
url=curdoc.Query_string_decoded(0)
r=Right(url,(Len(url)-Instr(url,"&"))-2)
url=r
r=Left(url,Instr(url,"&")-1)
Set db=s.currentdatabase
Set view=db.getview("V_roomlist")
Set doc=view.getfirstdocument
While Not doc Is Nothing
If doc.room(0)=r Then
Print |content-type:text/xml;charset=UTF-8;|
Print |<admin>|
Print doc.admin(0)
Print |</admin>|
End If
Set doc=view.getnextdocument(doc)
Wend
End Sub