function validate1()
	{
	if(creditor1_OK()==false)
		{
		return false;
		}
	document.form1.submit();
	}

//10-----------------
function checkOrderQtyOK(m_check_Qty)
	{
	var m_checkOK = "0123456789";
	var m_allValid = true;
	
	for (i = 0; i < m_check_Qty.length; i++)
		{
		m_ch = m_check_Qty.charAt(i);
		for (j = 0; j < m_checkOK.length; j++)

			if (m_ch == m_checkOK.charAt(j))
				break;

		if (j == m_checkOK.length)
			{
			m_allValid = false;
			break;
			}
		}

	if (!m_allValid)
		{
		return false;
		}
	return true;
	}

  
//-------------------------------------------
function creditor1_OK()
{
//check for product code

            if(document.form1.prod_code.value.length == 0)
		{
		alert ("Product code is mandatory,please fill it up");
		document.form1.prod_code.focus();
		return false;
		}

//check for supplier code

            if(document.form1.SC.value.length == 0)
		{
		alert ("Supplier code is mandatory,please fill it up");
		document.form1.SC.focus();
		return false;
		}

//check for product description

            if(document.form1.PD.value.length == 0)
		{
		alert ("Product description is mandatory,please fill it up");
		document.form1.PD.focus();
		return false;
		}

//check for total quantity recently available
            if(document.form1.TAQ.value.length == 0)
		{
		alert ("Total quantity is mandatory,please fill it up");
		document.form1.TAQ.focus();
		return false;
		}

           var m_check_Qty=document.form1.TAQ.value;
	
           if (checkOrderQtyOK(m_check_Qty) == false)
		{
		alert ("Please enter only numbers");
		document.form1.TAQ.focus();
		return false;
		}
	


//check for rate per unit of product
            if(document.form1.RPU.value.length == 0)
		{
		alert ("Rate per unit is mandatory,please fill it up");
		document.form1.RPU.focus();
		return false;
		}


     var m_check_Qty=document.form1.RPU.value;
	
       if (checkOrderQtyOK(m_check_Qty) == false)
		{
		alert ("Please enter only numbers");
		document.form1.RPU.focus();
		return false;
		}
	
return true;
}





