Some basic javascript usage
来源:互联网 发布:当前连接到网络2 编辑:程序博客网 时间:2024/05/26 12:01
In modern page design, JavaSricpt is quit important to do some input check at Client side.
In the comp231 project, we want to build a library management system based on Web, so JavaScript is used
Here I do some summary:
1. check whether the input of a form is Empty or not:
<SCRIPT LANGUAGE="JavaScript">
<!--
{
if(form.name.value.length==0)
alert("input empty");
else
form.submit();
}
//-->
</SCRIPT>
here, form is the name of the <form> and name is the text of pass name, in this check() the situation that all spaces in name can't be detected.
2. check whether the input is a Number or not
<SCRIPT LANGUAGE="JavaScript">
<!--
function check()
{
if(isNaN(aaform.aa.value))
alert("input is not a number");
else
alert("input is a number");
}
//-->
</SCRIPT>
3 check whether a checkbox is checked
<SCRIPT LANGUAGE="JavaScript">
<!--
function checkb()
{
if(myform.mycheckbox.check)
alert("checkd");
else
alert("not checked");
}
//-->
</SCRIPT>
- Some basic javascript usage
- some usage of define
- Some basic techniques for JavaScript Programming of Cognos Prompts 总结
- Basic usage about Canvas
- JSON Basic Usage
- some common usage of robocopy
- Some basic stuff
- Some Basic GDI+ Objects
- Some basic socket functions
- some basic linux commands
- Some Basic SQL Queries
- some basic knowledge
- Some Basic Knowledge
- some basic interview question
- github basic usage in windows
- Starting with FLEXIcontent (Basic usage)
- TensorFlow使用基础(Basic Usage)
- some javascript
- 一些实用的网页代码
- 成功需要“十商”
- [转]写给想当程序员的朋友
- JNDI学习
- 关于DLL的若干问题 [转载]
- Some basic javascript usage
- 写了两个月的黑白棋对战程序,发现早就有了GGS,互联网上的游戏。
- 新的博客,新的开始!
- “全球社区网格”
- javascript-action
- blog阅读好工具:Omea Reader
- 出差前留言
- GMAIL邀请!
- 嘿,什么时候给我你的数据字典?