I would like to have a errorMessage displayed in a webpage. When a
function is called the text changes. My code below replaces the html
page with the errorMessage instead of embedding it into the html code.
Its a stripped down version of the actual code but contains the same 3
pieces: An action to validate a form, the function to check if the
form is valid, and a function to display the type of error. Any
suggestions? -Nick
<html>
<head>
<script language="JavaScript" type="text/JavaScript">
function isError(error) {
if (error == 'yes') displayError("There has been an error");
}
</script>
</head>
<body>
<script language="JavaScript" type="text/JavaScript">
function displayError(errorMessage) {
document.write(errorMessage);
}
</script>
<a href="#" onClick="isError('yes')">Display Error</a>
</body>
</html>