GIF89a php
Current File : /home/hencockfreshchic/public_html/admin.cpanel/uploadjs/ValidateForm6.js
function ValidateForm6(theForm)
{
   var catt=$("#cat").val();
var subcat=$("#subcat").val();
var mff=$("#mff").val();
var image=$("#image").val();
var prod_cod=$("#prod_cod").val();

   if(catt==""){
       alert("Select category");
      $("#cat").focus();
      return false;
   }
    if(subcat==""){
       alert("Select sub-category");
      $("#subcat").focus();
      return false;
   }
   var regexp;
    regexp = /^[A-Za-zƒŠŒŽšœžŸÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-,.-_':;!@#$&]*$/;

   if (!regexp.test(theForm.pname.value))
   {
      alert("Invalid Product name");
      theForm.pname.focus();
      return false;
   }
   if (theForm.pname.value == "")
   {
      alert("Enter product name");
      theForm.pname.focus();
      return false;
   }
   if (theForm.pname.value.length < 3)
   {
      alert("Enter product name");
      theForm.pname.focus();
      return false;
   }
   if (theForm.pname.value.length > 100)
   {
      alert("Enter product name");
      theForm.pname.focus();
      return false;
   }

 regexp = /^[-+]?\d*\.?\d*$/;
   if (!regexp.test(theForm.qty.value))
   {
      alert("Enter quantity");
      theForm.qty.focus();
      return false;
   }
   if (theForm.qty.value == "")
   {
      alert("Enter quantity");
      theForm.qty.focus();
      return false;
   }
   if (theForm.qty.value.length < 1)
   {
      alert("Enter quantity");
      theForm.qty.focus();
      return false;
   }
   if (theForm.qty.value.length > 4)
   {
      alert("Enter quantity");
      theForm.qty.focus();
      return false;
   }

   regexp = /^[-+]?\d*\.?\d*$/;
   if (!regexp.test(theForm.rprice.value))
   {
      alert("Enter real price");
      theForm.rprice.focus();
      return false;
   }
   if (theForm.rprice.value == "")
   {
      alert("Enter real price");
      theForm.rprice.focus();
      return false;
   }
   if (theForm.rprice.value.length < 1)
   {
      alert("Enter real price");
      theForm.rprice.focus();
      return false;
   }
   if (theForm.rprice.value.length > 5)
   {
      alert("Enter real price");
      theForm.rprice.focus();
      return false;
   }
  
  
   regexp = /^[-+]?\d*\.?\d*$/;
   if (!regexp.test(theForm.sprice.value))
   {
      alert("Enter sale price");
      theForm.sprice.focus();
      return false;
   }
   if (theForm.sprice.value == "")
   {
      alert("Enter sale price");
      theForm.sprice.focus();
      return false;
   }
   if (theForm.sprice.value.length < 1)
   {
      alert("Enter sale price");
      theForm.sprice.focus();
      return false;
   }
   if (theForm.sprice.value.length > 5)
   {
      alert("Enter sale price");
      theForm.sprice.focus();
      return false;
   }
   regexp = /^[A-Za-z&#402;&#352;&#338;&#381;&#353;&#339;&#382;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-#-_,.]*$/;
   if (!regexp.test(theForm.pcode.value))
   {
      alert("Enter product code");
      theForm.pcode.focus();
      return false;
   }
   if (theForm.pcode.value == "")
   {
      alert("Enter product code");
      theForm.pcode.focus();
      return false;
   }
   if (theForm.pcode.value.length < 1)
   {
      alert("Enter product code");
      theForm.pcode.focus();
      return false;
   }
   if (theForm.pcode.value.length > 20)
   {
      alert("Enter product code");
      theForm.pcode.focus();
      return false;
   }

   if(mff=="")
   {
      alert("Enter product brand or manufacturer details");
      $("#mff").focus();
      return false;
   }

    //regexp = /^[A-Za-z&#402;&#352;&#338;&#381;&#353;&#339;&#382;&#376;ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþÿ \t\r\n\f0-9-,.-_':;!@#$&]*$/;
/*
   if (!regexp.test(theForm.desc.value))
   {
      alert("Invalid Description");
      theForm.desc.focus();
      return false;
   }*/
   /*if (theForm.desc.value == "")
   {
      alert("Enter product description");
      theForm.desc.focus();
      return false;
   }
   if (theForm.desc.value.length < 3)
   {
      alert("Enter product description");
      theForm.desc.focus();
      return false;
   }
   if (theForm.desc.value.length > 400)
   {
      alert("Enter product description");
      theForm.desc.focus();
      return false;
   }*/
   /* if (image =="")
   {
      alert("Select image");
      $("#image").focus();
      return false;
   }*/
    regexp = /^[-+]?\d*\.?\d*$/;
   if (!regexp.test(theForm.s_charge.value))
   {
      alert("Invalid shipping charge");
      theForm.s_charge.focus();
      return false;
   }
   if (theForm.s_charge.value == "")
   {
      alert("Enter shipping charge");
      theForm.s_charge.focus();
      return false;
   }
   if (theForm.s_charge.value.length < 1)
   {
      alert("Enter shipping charge");
      theForm.s_charge.focus();
      return false;
   }
   if (theForm.s_charge.value.length > 3)
   {
      alert("Enter shipping charge");
      theForm.s_charge.focus();
      return false;
   }
   if(prod_cod==""){
      alert("Select delivery type");
      $("#prod_cod").focus();
      return false;
   }

   return true;
}