上次同学说写搜索表单号要显示请输入,但是点击输入就点搜索,输入框的值是空的,点击输入框表单号消失,自己试了下
来源:互联网 发布:京东商城和淘宝销售额 编辑:程序博客网 时间:2024/06/06 09:38
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="context-type" content="text/html;charset=utf-8">
<script type="text/javascript">
function check(o){
if(o.value=='') {
document.getElementById('input_Info').style.display='block';
}
}
</script>
</head>
<body>
<form action="search" method="post">
请输入运单号:<input type="text" style="font-size:16px;font-weight:100;" id="search" name="search" onfocus="document.getElementById('input_Info').style.display='none';"
onblur="check(this);" /> <input type="submit">
<div id="input_Info" style="position:relative;top:-25px;left:115px;font-size:16px;font-weight:100;" onclick="document.getElementById('search').focus();">请输入...</div>
</form>
</body>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>My JSP 'index.jsp' starting page</title>
<meta http-equiv="context-type" content="text/html;charset=utf-8">
<script type="text/javascript">
function check(o){
if(o.value=='') {
document.getElementById('input_Info').style.display='block';
}
}
</script>
</head>
<body>
<form action="search" method="post">
请输入运单号:<input type="text" style="font-size:16px;font-weight:100;" id="search" name="search" onfocus="document.getElementById('input_Info').style.display='none';"
onblur="check(this);" /> <input type="submit">
<div id="input_Info" style="position:relative;top:-25px;left:115px;font-size:16px;font-weight:100;" onclick="document.getElementById('search').focus();">请输入...</div>
</form>
</body>
</html>
显示效果
鼠标点击输入框, 请输入消失 。。。。
还有一个是div 在table标签无法隐藏,可以在table里加一个tbody 里面放div 。
- 上次同学说写搜索表单号要显示请输入,但是点击输入就点搜索,输入框的值是空的,点击输入框表单号消失,自己试了下
- 输入框显示输入提示,点击消失
- 设计input搜索框提示文字点击消失的效果,提示文字与输入显示不同----->特别推荐
- webview点击输入框消失
- 禁用表单输入框的中文输入
- 常用的点击搜索框显示下拉框并实时刷新用户输入的内容
- jquery 实现:比如搜索的输入框显示“请输入”的样式
- 输入框显示输入提示,点击消失。没输入直接提交,提交的输入框内容为空,不提交显示的提示文字
- Android搜索框输入内容点击键盘的搜索按钮进行搜索
- 鼠标点击时输入框内的文本消失
- 制作点击输入框时默认文字消失的效果
- 搜索框中“请输入搜索关键字”
- js-点击输入框默认文字消失
- 输入框默认文字点击消失
- input输入框点击文字消失
- 搜索框输入文字显示搜索结果的效果
- android关于输入框弹出后 点击输入框以外的位置会让输入框消失
- android默认禁止输入框弹出 点击输入框以外的位置会让输入框消失(滚动监听)
- E:Could not open lock file /var/lib/dpkg/lock
- iPhone开发之深入浅出Object-C之消息
- 防止同一个账户异地登陆AND多用户同时登陆操作互不干扰
- POJ 1830(位运算+双向DFS)
- ANT详解
- 上次同学说写搜索表单号要显示请输入,但是点击输入就点搜索,输入框的值是空的,点击输入框表单号消失,自己试了下
- oracle数据库锁解除方法之一
- 采用多播传送FIX行情数据的推荐方案
- 制作手札---RPG是怎样做成的 (二)
- vmware-view-client for ubuntu
- live555 分析
- fedora修改密码
- 选择
- Objective-C 2.0的运行时编程(转)