|
边上有一个图片,点击图片后弹出一个新窗口,其中显示了一些可选择的信息,选择后关闭此页面.然后在原页面中的输入框中显示出选择的内容. 这如何实现? 是否要刷新一次原页面?如果不刷新可否? |
|
|
|
原来写过的一个函数,和你要的一样,
function SelClientInfo(v)//自动弹出选择客户编号对话框 { var strFeatures = "dialogWidth=400px;dialogHeight=300px;center=yes;help=no"; var CliNO="" if(window.event.keyCode==13 || window.event.keyCode==113) { if(window.event.keyCode==113) //F2 { CliNO=showModalDialog("ClientLst.asp?isClient="+v+"&CliNOName="+form1.CliNOName.value,0,strFeatures) if(CliNO=="") { return } form1.CliNO.value=CliNO.substr(0,CliNO.indexOf("|")) form1.CliNOName.value=CliNO } nextFocu() } } |
|
|
http://expert.csdn.net/Expert/topic/2361/2361313.xml?temp=.7313806
就是这个方法,看看吧 |
|
|
<HTML>
<HEAD> <TITLE>Master of all Windows</TITLE> <SCRIPT LANGUAGE="JavaScript1.1"> var myWind function doNew() { if (!myWind || myWind.closed) //attention the condition of "if()" { myWind = window.open("opener2.htm","subWindow","HEIGHT=200,WIDTH=350,resizable") } else { // bring existing subwindow to the front myWind.focus() } } </SCRIPT> </HEAD> <BODY> <FORM NAME="input"> Select a color for a new window: <!--<INPUT TYPE="radio" NAME="color" VALUE="red" >Red--> <INPUT TYPE="radio" NAME="color" VALUE="yellow">Yellow <INPUT TYPE="radio" NAME="color" VALUE="blue">Blue <INPUT TYPE="button" NAME="storage" VALUE="Make a Window" onClick="doNew()"> <HR> This field will be filled from an entry in another window: <INPUT TYPE="text" NAME="entry" SIZE=25> </FORM> </BODY> </HTML> opener2.htm: <HTML> <HEAD> <TITLE>New Window on the Block</TITLE> <SCRIPT LANGUAGE="JavaScript"> <!-- function getColor() { // shorten the reference colorButtons = self.opener.document.forms[0].color // see which radio button is checked for (var i = 0; i<colorButtons.length; i++) { if (colorButtons[i].checked) { return colorButtons[i].value } } return "white" } //--> </script> </HEAD> <!--<SCRIPT LANGUAGE="JavaScript"> document.write("<BODY BGCOLOR='" + getColor() + "'>") </SCRIPT>--> <body BGCOLOR="getColor()"> <!--there is the problem--> <H1>This is a new window.</H1> <FORM> <INPUT TYPE="button" VALUE="Who's in the Main window?" onClick="alert(self.opener.document.title)"> Type text here for the main window: <INPUT TYPE="text" SIZE=25 onChange="self.opener.document.forms[0].entry.value = this.value"><!--attention "this.vlaue"--> </FORM> </BODY> </HTML> |
|