Question : hasError property of a form

I'm trying to create an hta with form valadation and I noticted a "hasError" property.
This website http://www.quirksmode.org/dom/error.html in particular makes use of that property in its code.
However a listing of the DOM api, here http://download.oracle.com/docs/cd/E17476_01/javase/1.4.2/docs/guide/plugin/dom/index.html
and http://www.w3.org/TR/1999/REC-html401-19991224/interact/forms.html#edef-FORM contain no such reference to that element.
I realize that its in javascript, and not vbscript, but the properties for any xhtml dom objects should be the same, right? I'm just trying to break into form valadation and working with the DOM, however I need to know how all the pieces fit and it would be nice to know how somehting like form valadtion works.
I'm wondering where the "hasError" property defined and whether or not its language specific?
Thanks in advance
Also please forgive my poor coding, I'm just starting with this and trying to focus on the basics.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
<html>
<head>
<title>HTest Script</title>
<link rel="stylesheet" type="text/css" href="test.css" />

<HTA:APPLICATION 
     ID="objHTAHelpomatic"
     APPLICATIONNAME="Test Script"
     SCROLL="yes"
     SINGLEINSTANCE="yes"
     WINDOWSTATE="maximize"
>
</head>

<SCRIPT Language="VBScript">
	Function SetFontColor(strID, strColor)
		'Variable Declaration
		Dim objDoc, objEm, objForm
		
		'Variable Setting

		'Function Body
		 Set objEm = document.getElementById(strID)
		 Set objForm = document.forms(0).elements
                    objForm(0).hasError = "True"
		 alert(objForm(0).hasError) 'it should work
		 
		 objEm.style.color = strColor	
	End Function	
</SCRIPT>
<body>
<h1 id="normalTxt" >Hello World </h1>
<input TYPE=BUTTON VALUE="change color to green" name="button1" onClick='Call SetFontColor("normalTxt", "green")'>
<br />
<form nane="firstForm" >
Input: <input type="text" name=firstInput id="firstInput" />
</form>
</body>
</html>

Answer : hasError property of a form

It is just a value set in the form object
Not a built-in one

Better to use
obj.setAttribute('hasError',true)

and use getAttribute too
Random Solutions  
 
programming4us programming4us