Please note the changes...
<html lang="en">
<head>
<meta "charset=utf-8" />
<title>Trying It Out</title>
<script type="text/javascript">
function checkForm()
{
var str = ''; //for testing purposes later
var e = document.getElementById("myForm").elements;
for (var i = 0; i < e.length; i++) {
var val = e[i].value;
if (val.length == "" ) {
alert("The Field " + e[i].name + " is blank")
e[i].focus();
return false;
}
}
}
</script>
</head>
<body>
<form id="myForm" name="myForm" action="showIt.htm">
Your Name:
<input id="Your_Name" type="text" name="Your_Name" value="enter your name" />
Interesting Fact About You:
<textarea id="Interesting_Fact" name="Interesting_Fact">something about you</textarea>
<input type="submit" value="Submit Data" onclick="return checkForm()" />
</form>
</body>
</html>