很菜的问题,但是不明白。。。验证控件的动态显示和静态显示有什么区别?

Morgan_ma 2003-01-29 11:23:37
请详细点。。。
...全文
76 7 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
qiangsheng 2003-05-20
  • 打赏
  • 举报
回复
借这个地方再多问一句。

我希望把所有验证控件放在一起显示,但是又希望每次只显示第一个,不要影响到整个布局,怎么办?
比如说,我有5个验证控件,如果条件都不满足,就会显示出来五个,比较乱,我想只显示一个出来,其他的再提交再显示。
nboys 2003-05-04
  • 打赏
  • 举报
回复
静态:表示会为整个出错信息保留空间,在这种情况下,当出错信息显示的时候页面布局就不会改变
动态:表示当出错文本显示的时候控件会占用页面空间,这会导致页面布局的改变
nboys 2003-05-04
  • 打赏
  • 举报
回复
对,静态跟动态区别就是页面的格式会不会发生变化!
alieneagle 2003-05-04
  • 打赏
  • 举报
回复
静态验证控件指的是页面显示时,该验证控件占据固定位置
动态验证控件在显示时,若不出错,它不占固定位置,出错时,他的message动态显示,并把其后的控件往后面挤开,尤其在排版模式为FlowLayout时,这样的设置非常有效
saucer 2003-01-30
  • 打赏
  • 举报
回复
save the following into a html file and click on the buttons, notice the position of the first button changes when the message is displayed or hidden


<span id="dynamic" style="display:none">error messages</span>
<input type="button" value="show/hide" onclick="if (dynamic.style.display=='') dynamic.style.display='none'; else dynamic.style.display= '';">

<br><br>
<span id="static" style="visibility:hidden">error messages</span>
<input type="button" value="show/hide" onclick="if (static.style.visibility=='hidden') static.style.visibility='visible'; else static.style.visibility= 'hidden';">
Morgan_ma 2003-01-30
  • 打赏
  • 举报
回复
动态显示"display:none" 不是dynamic吗?
静态显示"visibility:hidden"不是static吗?

谁能举个例子阿。。。我还是不明白。。。
saucer 2003-01-29
  • 打赏
  • 举报
回复
it is just the way how the messages are hidden

动态显示:<span style="display:none" >message here</span>
does not occupy space in the page flow

静态显示:<span style="visibility:hidden">message here</span>
does occupy space in the page flow

62,244

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧