How to dynamically display the tips or help on the text box
来源:互联网 发布:苹果手机mac地址 编辑:程序博客网 时间:2024/06/05 00:38
<!--html file-->
<html>
<head>
<title>
test Dynamic Content
</title>
<!--if you want to copy my code, please change here for your personal js file-->
<script src="test.js" type="text/javascript">
</script>
</head>
<body>
<form action="">
<p style="font-weight:bold;">
<span style=" font-style:italic">
Customer Information
</span>
<br /><br />
<label>
Name:
<input type="text" onmouseover="message(0)" onmouseout="message(4)" />
</label>
<br /><br />
<span style="font-style:italic">
To create an account, provide the following:
</span>
<br /><br />
<label>
UserID:
<input type="text" onmouseover="message(2)" onmouseout="message(4)" />
</label>
<label>
Password:
<input type="text" onmouseover="message(3)" onmouseout="message(4)" />
</label>
<br />
<textarea id="adviceBox" rows="3" cols="50"
style="position:absolute; left:20px; top:0;">
This box provides on filling out the form on this page. Put the mouse cursor over any
input field to get advice.
</textarea>
<br /><br />
<input type="submit" value="Submit" />
<input type="reset" value="Reset" />
</p>
</form>
</body>
</html>
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var helpers = ["your name must be in the form: \n \
first name, middle name, last name",
"your email address must have the form:\
user@domain",
"Your userId must have at least six characters",
"Your password must have at least six characters\
and it must include one digit",
"This box provides advice on filling out\
the form on this page. Put the mouse cursor over any\
input field to get advice"];
function message(adviceNumber) {
//here we can change this function for displaying in different text area;
document.getElementById("adviceBox").value = helpers[adviceNumber];
}
//The most important thing is to remember how to create js array, if you know how to use this, it will be not a problem for you to understand this code.
- How to dynamically display the tips or help on the text box
- How to dynamically change label text on PyGTK
- How to display the data from database on JTable
- How to change the text color on UINavigationBar button items
- Dynamically changing the linearlayout width or height on Android
- How to create the index on view or table
- How to: Display a Dialog Box for Selecting Entries from the Contacts Folder
- How to change the name of logfile dynamically using log4j
- How to delete the log file of log4j dynamically
- How JavaScript works: inside the V8 engine + 5 tips on how to write optimized code
- How to hidden/display the left panel?
- How to remove the copyright box on a paper that uses the ACM sig-alternate.cls class file?
- The following tips could help
- NSButton how to color the text
- How do I set the DISPLAY variable on Linux
- How to shutdown or reboot the machine on remote desktop connection?
- How to install or upgrade UV4L on Raspbian (for the Raspberry Pi)
- how to intall stardict on the ubuntu
- 合并table相同单元格的jquery插件
- 杭电OJ——Let the Balloon Rise
- 为easyui combobox添加默认选项
- J2SE学习笔记:J2SE重点难点,数组排序、HashSet去重、HashMap遍历
- 2013-10-20【学习汇报】
- How to dynamically display the tips or help on the text box
- jquery 合并相邻且内容相同单元格
- Java中读取XML文件,生成XML格式的字符串并解析这个字符串
- 杭电——Max Sum
- Linux下利用Valgrind工具进行内存泄露检测和性能分析
- shell编程必须要掌握的命令,xargs
- ERROR 1045: Access denied for user: 'root@localhost' (Using password: YES)
- 如何使用SendMessage函数实现模拟鼠标点击按钮事件?
- python 采用代理模拟登陆代码