i am trying to find what is wrong with that but i can't find it

function check_form(formid)
{
	var field=document.getElementById(formid);
	var wrongs=0;
	document.write("lol");
	document.write(field.length);
	for (i=0;i<field.length;i++)
	{
		k=field[i];
		temp=k.name;
		document.write(temp);
		if (temp.indexOf('email')==0)
		{
			document.write("lalala email");
			if (check_mail(formid,temp)==true)
			{
				wrongs++;
				document.write(temp);
			}
		}
		else
		{
			
			if (temp.indexOf('til')==0)
			{
				document.write("lalala til");
				m=isValidPhone(formid,temp);
				if (m==true)
			    {
					document.write("Itan lathos");
					wrongs++;
					document.write(temp);
				}
				
			}
			else
			{
				
	           if (k.value=="")
	           {
		         
				  document.getElementById("wrong_"+temp).innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;Κενό πεδίο";
		          
				  wrongs++;
	           }
 	           else
	           {
		            document.writeln("ola ok");
		            document.getElementById("wrong_"+field).innerHTML="";
	            }
			}
		}
	}
}

when it goes to this command 'document.getElementById("wrong_"+temp).innerHTML="&nbsp;&nbsp;&nbsp;&nbsp;Κενό πεδίο";' it stops and i can't find why. Can you please help me?
Thank you very much

Are you sure there is an element with the id "wrong_"+temp ?

yes i am sure that there is this element

What if you remove the Greek "Κενό πεδίο" ?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.