Hi,

I am trying to do form validation and make the submit button dissapear.

This is for a photocontest and I really want the submit button to dissapear while the image uploads and also need the basic validation.

both of these scripts work independantly but not together.

I changed the variable names in the validate function but it didnt help.

Code:
function loading(whichElement,whichFunction,whichProperty,whichValue){
	var ns6 = document.getElementById && !document.all;
	var ie = document.all;
	
	var whichElementArray = whichElement.split(",");
	var whichFunctionArray = whichFunction.split(",");
	var whichPropertyArray = whichProperty.split(",");
	var whichValueArray = whichValue.split(",");

	for(var i=0; i<whichElementArray.length; i++){
		if(ie){
			if(whichFunctionArray[i] == "setTEXT"){	eval("document.all."+whichElementArray[i]).innerHTML = whichValueArray[i];}
		}
		else if(ns6){
			if(whichFunctionArray[i] == "setTEXT"){	document.getElementById(whichElementArray[i]).innerHTML = whichValueArray[i];}
		}
	}
}

function validateme(what) {
var pass=true;
if (document.images) {
for (j=0;j<what.length;j++) {
var checkme=what.elements[j];
if (checkme.name.substring(0,2)=="xx") {
if (((checkme.type=="text"||checkme.type=="textarea")&&
checkme.value=='')||(checkme.type.toString().charAt(0)=="s"&&
checkme.selectedIndex==0)) {
pass=false;
break;
         }
      }
   }
}
if (!pass) {
validatename=checkme.name.substring(2,30).toUpperCase();
alert("Your "+validatename+" Is Required.");
return false;
}
else
return true;
}
I am calling the two functions like this

onSubmit="return validateme(this);loading('output_div2','setTEXT','','<img src= ./loading.gif Uploading Image')"

If anyone can help with this it will be muchly appreciated.

Thanks
Loren