<html>
<head>
<script type="text/javascript" src="/webapp/scripts/file.js"></script>

<script>
function test(field)
{
	alert("hello");
}
</script>

</head>
<body>
<form>
<p>
numeric field 1: 
<INPUT type="text" name="test1" size="20" onblur="test(this)">
</p>

<p>
numeric field 2: 
<INPUT type="text" name="test2" size="20">
</p>
</form>
</body>
</html>

satya - Thursday, July 15, 2010 11:28:04 AM

A simple onload example


<html>
<head>
<script>
function onl()
{
    alert('hello');
}
</script>
</head>
<body onload="onl()">
<p>Hello
</body>
</html>

satya - Thursday, July 15, 2010 1:12:17 PM

A simple jquery example


<html>
<head>
<script type="text/javascript" src="jquery.js"></script>
<script>
function onl()
{
    alert('hello');
    getx();
}
function getx()
{
    alert($("#my_div_id > #ape").html());
}
</script>
</head>
<body onload="onl()">
<p>Hello

<div id="my_div_id">
<span id="ape" style="visibility:hidden">
answer="yes"
</span>
</div>
</body>
</html>

satya - Friday, February 24, 2012 11:45:53 AM

How to read a form field


var nfname = document.RenameForm.foldername_field.value;
if (nfname == "")
{
   alert("you need a folder name");
   return;
}

satya - Fri Apr 20 2012 13:49:43 GMT-0400 (Eastern Daylight Time)

Here is another example


<html>
<head>
<script>
function test(field)
{
   alert("hello");
}
</script>
</head>

<body>
<form action="javascript:test()">
<p>Click the following button to run a post
<p>
<input type="submit" name="ClickMe" value="ClickMeValue"/>
</p>
</form>
</body>
</html>