span value change

wxdqz

New Member
Dear Friends ,

I have problem about below script document.form1.errortext.value='OK'; line, I cant change
span' s value.

Please help
Thanks


<SCRIPT language=JavaScript>
<!-- Begin
function checkrequired() {

var fields = 0
var i = 0
var empty = true
var fields = document.form1.length
var textvalue = ""

for (i = 0; i < fields ; i++) {
switch (document.form1.elements.type){
case "select-one" :
break;
case "select-multiple" :
if (document.form1.elements.selectedIndex != -1){
empty = false
}
break;
case "checkbox" :
if ( document.form1.elements.checked) {
empty = false
}
break;
default :
break;
}
}

if (!empty) {
document.form1.submit();
} else {
document.form1.errortext.value='Select one or more item';
return false;

}
}
// End -->
</SCRIPT>

<form name=form1 method="POST" action="check.asp">

<SPAN class=errortext>You must check at least one of the available domain
names below to continue.</SPAN>

<input type="checkbox" name="k1" value=http://www.webdeveloper.com/forum/archive/index.php/"astim" class="input">
<input type="checkbox" name="k2" value="whax" class="input">
<input onclick="return checkrequired();" type="image" SRC="ok.gif" border="0" name="submitit" >
</form>
 
Back
Top