在帧前显示DHTML弹出窗口/启用禁用/只读文本框 [英] Show DHTML popup window in front of frames/enable disabled/read-only text box

查看:47
本文介绍了在帧前显示DHTML弹出窗口/启用禁用/只读文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我在innerHtml中遇到了一些问题。我在innerHtml中有文本框,在innerHtml文本框中是只读的。我想让它启用。如果用户输入要检索文本的文本,那么我想启用文本框。另一个问题是innerhtml将在弹出窗口中。它将自动关闭。我希望每当我点击关闭按钮时,它只会关闭。请帮帮我。


这里是守则


[HTML]< html>

< body>

< script type =" text / javascript">

function show_popup23()

{$ / $

var p = window.createPopup();

var pbody = p.document.body;

// pbody .style.filter = QUOT;α(不透明度为100)" ;

pbody.style.fontSize =" 10px";

pbody.style.align =" center" ;;

pbody.style。 fontFamily =" Verdana,Arial,Helvetica,sans-serif" ;;

pbody.document.body.innerHTML = oToolTip.innerHTML;

p.show(0,0,800,500 ,document.body);


}

< / script>


< a onClick =" ; show_popup23()">点击我< / a>

< div id =" oToolTip"风格= QUOT;显示:无; ">

< div id =" block"风格= QUOT;垂直对齐:中部;宽度:100%;高度:100%;边框:2px纯黑色; filter:progid:DXImageTransform.Microsoft.Gradient(GradientType = 0,StartColorStr =#cdcdcd,EndColorStr =#FFFFFF);填充:0px">


< table border =" 0"宽度= QUOT; 100%QUOT;高度= QUOT; 100%QUOT; CELLPADDING = QUOT; 0" CELLSPACING = QUOT; 0" BORDERCOLOR =" 000000"对齐= QUOT;中心"类= QUOT; txttype1" >

< tr bgcolor ="#9B9AB7">< td colspan =" 4" height =" 1px">< / td>< / tr>

< tr>< td align =" center" valign =" middle">

< table class =" txttype1"边界=" 0" BORDERCOLOR ="#000000" CELLPADDING = QUOT; 0" cellspacing =" 0">

< tr>

< td bgcolor ="#9B9AB7" width =" 1px">< / td>

< td height =" 22px" width =" 150px">< font size =" 1px" face =" Verdana,Arial,Helvetica,sans-serif"> Headeing< / font>< / td>

< td align =" right">< a onclick = " pbody.hide()">< img src =" images / close.gif">< / a>< / td>

< td bgcolor =" ;#9B9AB7" width =" 1px">< / td>

< / tr>

< tr>

< td bgcolor ="#9B9AB7" width =" 1px">< / td>

< td bgcolor =" #ffffff" height =" 25px">< font size =" 1px" face =" Verdana,Arial,Helvetica,sans-serif">输入名称< / font>< / td>

< td bgcolor =" #fffff">< input type =" text"类= QUOT;文本框"命名= QUOT;名称"值= QUOT; sadas" /> < / TD>

< td bgcolor ="#9B9AB7" width =" 1px">< / td>< / tr>

< tr>

< td bgcolor ="#9B9AB7" width =" 1px">< / td>

< td bgcolor =" #ffffff"列跨度= QUOT; 2英寸对齐= QUOT;中心" height =" 40px">< input type =" submit"值= QUOT;完成"名称= QUOT;完成" >< input type =" reset"值= QUOT;清零"命名= QUOT;清零" > < / td>

< td bgcolor ="#9B9AB7" width =" 1px">< / td>

< / tr>

< tr bgcolor ="#9B9AB7">< td colspan = QUOT; 4英寸height =" 1px">< / td>< / tr>

< / table>

< / td>< / tr>

< / table>

< / div>

< / div>

< / body> ;< / html> [/ HTML]

Hi All,

I have some problem in innerHtml. I have the textbox in innerHtml, In the innerHtml textbox was read only. I want make it to enable. if user enter the text that text will be retrieved, so i want to be enable text box. Another one problem is the the innerhtml will be in like popup window. it will automatically closed.i want be whenever i click close button that time only it will close. Please help me.

here is the Code


[HTML]<html>

<body>
<script type="text/javascript">
function show_popup23()
{

var p=window.createPopup();
var pbody=p.document.body;
//pbody.style.filter="alpha(opacity=100)" ;
pbody.style.fontSize="10px";
pbody.style.align="center";
pbody.style.fontFamily="Verdana, Arial, Helvetica, sans-serif";
pbody.document.body.innerHTML=oToolTip.innerHTML;
p.show(0,0,800,500,document.body);

}
</script>

<a onClick="show_popup23()">Click Me</a>
<div id="oToolTip" style="display:none; ">
<div id="block" style=" vertical-align:middle; width:100%; height:100%; border:2px solid black; filter:progid:DXImageTransform.Microsoft.Gradient( GradientType=0, StartColorStr=#cdcdcd, EndColorStr=#FFFFFF); padding:0px">

<table border="0" width="100%" height="100%" cellpadding="0" cellspacing="0" bordercolor="000000" align="center" class="txttype1" >
<tr bgcolor="#9B9AB7"><td colspan="4" height="1px"></td></tr>

<tr><td align="center" valign="middle">
<table class="txttype1" border="0" bordercolor="#000000" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#9B9AB7" width="1px"></td>
<td height="22px" width="150px"><font size="1px" face="Verdana, Arial, Helvetica, sans-serif">Headeing</font></td>
<td align="right"><a onclick="pbody.hide()"><img src="images/close.gif"></a></td>
<td bgcolor="#9B9AB7" width="1px"></td>
</tr>
<tr>
<td bgcolor="#9B9AB7" width="1px"></td>
<td bgcolor="#ffffff" height="25px"><font size="1px" face="Verdana, Arial, Helvetica, sans-serif">Enter the Name</font></td>
<td bgcolor="#ffffff"><input type="text" class="textbox" name="name" value="sadas" /> </td>
<td bgcolor="#9B9AB7" width="1px"></td></tr>
<tr>
<td bgcolor="#9B9AB7" width="1px"></td>
<td bgcolor="#ffffff" colspan="2" align="center" height="40px"><input type="submit" value="Done" name="done" ><input type="reset" value="Clear" name="clear" > </td>
<td bgcolor="#9B9AB7" width="1px"></td>
</tr>
<tr bgcolor="#9B9AB7"><td colspan="4" height="1px"></td></tr>
</table>
</td></tr>
</table>
</div>
</div>
</body></html>[/HTML]

推荐答案

什么是 createPopup ?您需要定义此函数,或者您需要使用 window.open 。同样适用于 show


你不能像这样参考oToolTip。您需要将此语句添加到您的代码中:
What is createPopup? Either you need to define this function, or you would need to use window.open instead. And same goes for show.

And you can''t refer to oToolTip like this. You need to add this statement to your code:
展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


我想补充一点,createPopup()的替代方法是DHTML弹出窗口。虽然这些建议可能无法直接回答您的问题,但从长远来看,它们会帮助您解决问题。您只使用专有代码编写一个浏览器,这在任何其他浏览器中都无法使用。尽快摆脱这种习惯,因为其他浏览器每年都会占据更大的市场份额。


Re。你的问题:我在代码中看不到文本框是只读的。


PS。发布代码时请使用代码标签。
I would add that the alternative to createPopup() would be a DHTML popup window. Although those suggestions may not answer your question directly, they will help you out in the long run. You''re coding only for one browser using proprietary code which will not work in any other browser. Get out of that habit as soon as possible as the other browsers are taking a larger share of the market year in year out.

Re. your question: I can''t see the text box as being read-only in your code.

PS. please use code tags when posting code.



什么是 createPopup ?您需要定义此函数,或者您需要使用 window.open 。同样适用于 show


你不能像这样参考oToolTip。您需要将此语句添加到您的代码中:
What is createPopup? Either you need to define this function, or you would need to use window.open instead. And same goes for show.

And you can''t refer to oToolTip like this. You need to add this statement to your code:
展开 | 选择 | Wrap | < span class =codeLinkonclick =LineNumbers(this);>行号


这篇关于在帧前显示DHTML弹出窗口/启用禁用/只读文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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