弹出一次 [英] pop up once

查看:75
本文介绍了弹出一次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




任何人都可以帮我创建一次弹出窗口。点击文本框


[HTML]< html>

< head>

< script type =" ; text / javascript">

函数abc()

{

var wind1 = null;

var tmp = null;

wind1 = window.open('''',''displayWindow'',''width = 400,height = 300,status = no,toolbar = no,menubar = no ,scrollbars = no'');

wind1.document.write("< script> function alert1(f){");

wind1.document。 write(" var frmdst = f.ta.value;");

wind1.document.write(" window.opener.tmp = frmdst;");

wind1.document.write(" window.opener.getValues();");

wind1.document.write(" window.close();");

wind1.document.write("}< \ / script>");

wind1.document.write("< html>< body> ;< form action =''#''name =''myform''method =''post''>< TEXTAREA rows =''''''cols = '20''name =''ta''>< / TEXTAREA>< br>< INPUT type =''button''value =''save''onclick =''javascript :alert1(this.form);''>< INPUT type =''button''value =''cancel''onclick =''javascript :window.close();' '>< / form>< / body>< / html>");

}

函数getValues()

{

document.forms [" source"]。elements [" srctext"]。value = tmp;

}

< ; / script>

< / head>

< body>

< form action ="#"名称= QUOT;源" method =" get">

< input type =" text" onclick =''abc();''name =" srctext"值= QUOT;"大小= QUOT; 20" />

< / form>

< body>

< / html> [/ HTML]

Hi,

can any one help me to create the pop up only once. on clicking the text box

[HTML]<html>
<head>
<script type="text/javascript">
function abc()
{
var wind1=null;
var tmp=null;
wind1 = window.open('''', ''displayWindow'', ''width=400,height=300,status=no,toolbar=no,menubar =no,scrollbars=no'');
wind1.document.write("<script> function alert1(f){");
wind1.document.write("var frmdst=f.ta.value;");
wind1.document.write("window.opener.tmp=frmdst;");
wind1.document.write("window.opener.getValues();") ;
wind1.document.write("window.close();");
wind1.document.write("}<\/script>");
wind1.document.write("<html><body><form action=''#'' name=''myform'' method=''post''><TEXTAREA rows=''2'' cols=''20'' name=''ta''></TEXTAREA><br><INPUT type=''button'' value=''save'' onclick=''javascript:alert1(this.form);''><INPUT type=''button'' value=''cancel'' onclick=''javascript:window.close();''></form></body></html>");
}
function getValues()
{
document.forms["source"].elements["srctext"].value = tmp;
}
</script>
</head>
<body>
<form action="#" name="source" method="get">
<input type="text" onclick=''abc();'' name="srctext" value="" size="20" />
</form>
<body>
</html>[/HTML]

推荐答案

只使用一个变量:

just use a variable:

展开 | 选择 | Wrap | 行号



只使用一个变量:

just use a variable:

展开 | 选择 | Wrap | 行号


因为你没有告诉那个应该是真的要求:) ...当你在弹出窗口中点击取消时,只需将开启器中的变量 run 设置回0即可。


亲切的问候
since you didn''t tell that that is a requirement this should be true :) ... just set the variable run in the opener back to 0 when you click cancel in your popup :)

kind regards


这篇关于弹出一次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆