jsp中控件或文字的隐藏、控件的不可用
来源:互联网 发布:小学生趣味编程 编辑:程序博客网 时间:2024/06/05 19:46
/*原因:为了在表单提交时对必添项的js验证后,对为空的项后显示红色的*号。拓展请参照代码修改*/
<!----------------------星号的隐藏--------------------------->
1.----------------<br>
<body>
<form name="form1">
<input type="text" name="txt"><span id="star" class="txt_2" style="display:true"> *</span>
<br>
<input type="button" name="Submit" value="验证" onclick="OnClick()">
</form>
</body>
<script>
function OnClick() {
//alert(document.form1.txt.value);
//判断提交条件
if(document.form1.txt.value==""){
//alert('上传文件不能为空!');
document.all.star.style.display="none";
document.form1.txt.focus();
return;
}
}
</script>
<!----------------------------按钮的隐藏--------------------------------->
按钮的隐藏
<br>
1.-------------------<BR>
<script language="javascript">
function dis(){
document.all["button1"].disabled=true
}
function hid(){
document.all["button1"].style.display="none"
}
</script>
<input type=button name="button1" value="测试按钮"> <br>
<input type=button onclick="dis()" value="不可用">
<input type=button onclick="hid()" value="隐藏">
<p>
2.-------------------<BR>
<input id="Button1" type="button" value="这是一个按钮"><br>
<input type=button onclick="Button1.style.display='none'" value="不可见">
<input type=button onclick="Button1.style.display=''" value="可见">
<input type=button onclick="Button1.disabled=true" value="不可用">
<input type=button onclick="Button1.disabled=false" value="可用">
<br><br>
<input type=button value="不可用" disabled>
<input type=button value="不可见" style="display='none'">
- jsp中控件或文字的隐藏、控件的不可用
- EXT 中控件的隐藏,显示,不可用
- jqurey控制控件的可用不可用
- Android的ToggleButton控件隐藏提示文字或清除提示文字占用空间的解决办法
- silverlight4beta中richtextarea插入控件不可用的问题
- HTML控件不可读或不可用
- 关于Calendar控件的不可用问题/
- jsp页面“占位隐藏控件”和“不占位隐藏控件”
- vc控制控件的可用和隐藏和名称
- android api 中setVisibility( )的用法(可显示或隐藏布局或控件...)
- 在 Android 的文字编辑控件 (TEdit) 中, 如何按下 Enter 就隐藏虚拟键盘
- 自定义控件在Visual Studio 2008的工具箱中是灰色(不可用)的解决办法
- 隐藏和显示一个控件 设置按键不可用
- GridView控件的“编辑”,“删除”不可用的问题
- 在vs2010中添加了ajax控件但是是灰色不可用的状态,如何显示
- UILabel iOS中添加文字的控件
- 让tabcontrol控件的某个选项卡不可用
- 解决联想 Pad 浏览器上控件不可用的问题
- SQL防注入
- 日本IT劳工的生活就要开始了
- 日本IT劳工的生活就要开始了
- 日本IT劳工的生活就要开始了
- 华为面试题
- jsp中控件或文字的隐藏、控件的不可用
- collections&Collection
- 小心药和饮食的相互作用导致中毒
- delphi摄像头编程
- 是耻还是花 武汉大学的樱花是国耻吗
- Spring与WebLogic Server的集成
- 恺撒加密与解密小程序
- VC常用数据类型使用转换详解
- 老外在中国首都是怎样撒野的--本人亲身经历的一件事!