我是初學.
window.open('returnunitname1.asp?spellcoding='+UnitSSN1+"&Citycode="+Citycode+"&ProvinceCode="+ProvinceCode,'register','left=180,top=255,width=250,height=380,status=no,toolbars=no,menubars=no,scrollbars=auto,resize=no');
是你開的新窗口吧..我想所有聯繫人的組織應該在這裡實現吧.
這裡也需要自己重新組織窗口
window.open('returnunitname1.asp?spellcoding='+UnitSSN1+"&Citycode="+Citycode+"&ProvinceCode="+ProvinceCode,'register','left=180,top=255,width=250,height=380,status=no,toolbars=no,menubars=no,scrollbars=auto,resize=no');
是你開的新窗口吧..我想所有聯繫人的組織應該在這裡實現吧.
這裡也需要自己重新組織窗口
返回去之后又如何显示
如果要將多個值來回傳送於對話框方塊及建立的視窗之間,應該使用陣列或者物件.下面給你個例子代碼,用來要求多個資訊以及如何傳送多個資訊回應用程序.
<HTML>
<HEAD>
<TITLE>User Information</TITLE>
<STYLE TYPE="text/css">
BODY {margin-left:lOpt; background:menu}
</STYLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
function saveValues() {
var retVal = new Array;
for (var intLoop = 0; intLoop < document.userInfo.length;intLoop++)
with (document.UserInfo[intLoop])
if (name !="")
retVal[name] = value;
window.returnValue = retVal;
event.returnValue = false;
window.close();
}
</SCRIPT>
</HEAD>
<BODY>
<!--此表單是用於把內容含有控制項組合而成一容易讀取得陣列 -->
<FORM NAME="UserInfo">
<FILEDSET>
<LEGEND>User Information</LEGEND>
<P>User Name: <INPUT TYPE=TEXT NAME="User">
<P>address: <TEXTAREA ROWS="3" NAME="address"></TEXTAREA>
</FILEDSET>
</FORM>
<P STYLE="text-align:center>
<INPUT TYPE=SUBMIT STYLE="width:5em" ONCLICK="saveValues();" VALUE="OK>
<INPUT TYPE=RESET ONCLICK="window.close();" VALUE="Cancel">
</BODY>
</HTML>
假如上面檔案是在一個UserInfo.htm檔案裡面.也就相當於你的window.open里得內容
下面程序是把上面傳回得信息顯示在一個獨占方式得對話快中.然後循環報告回傳值:
<SCRIPT LANGUAGE="JavaScript">
var vals = new Array();
vars = window.showModalDialog("UserInfo.htm");
if (vals != null) {
strOut = "Returned values:";
for (name in vals)
strOut += "\n"+name+" = "+vals[name];
alert(strOut);
}
</SCRIPT>
%>
<% While Not Rs.Eof Sql2="select * from personnalbaseinfo where unitssn='"&Rs("unitssn")&"' and (ProvinceCode='"&trim(request("ProvinceCode"))&"' and Citycode='"&trim(request("Citycode"))&"')"
response.write sql2
set rs2=server.createobject("adodb.Recordset")
rs2.open sql2,conn,1,3
dim person
person=""
While Not rs2.Eof
person=person+rs2(personnalname)+";"
rs2.Movenext
Wend
rs2.Close
Set rs2=Nothing
%>
<tr bgcolor="#FFFFFF">
<td width="17">
<input type="radio" name="unitname" value="<%=Rs("unitname")%>" onclick="check('<%=Rs("unitname")%>','<%=person%>','<%=Rs("Address")%>')">
</td>
<td width="126"><%=Rs("unitname")%></td>
<td width="53"><%=Rs("spellcoding")%></td>
</tr>
<% Rs.Movenext
Wend
Rs.Close
Set Rs=Nothing
%>
<% Else %>
<tr bgcolor="#FFFFFF">
<td colspan=3>没有此单位</td>
</tr>
<% End If %>
function check(t,s,m){
opener.document.form1.Address.value=m;
ClientDutyPerson=s.split(";");
for(i=0;i<ClientDutyPerson.length-1;i++)
{
opener.document.form1.ClientDutyPerson.options[i].value=ClientDutyPerson[i];
opener.document.form1.ClientDutyPerson.options[i].text=ClientDutyPerson[i];
opener.document.form1.ClientDutyPerson.options.length++;
}
opener.document.form1.ClientDutyPerson.options.length--; opener.document.form1.unitname.value=t;
self.close();
}
</script>
我还有一个小小的请求
请问opener.document.form1.ClientDutyPerson.options.length--;是什么意思
<td width="108">单位联系人</td>
<td width="201">
<select name="ClientDutyPerson"><option></option></select>
</td>