<!--category validation-->
function validate(frm,fld) {

  var message='';
  var fvalid=true;

  if (frm.category1.value=='') {
    fvalid=false;
    message+='Please enter Category<br>';
  }

 if (frm.description1.value=='') {
    fvalid=false;
    message+='Please enter Description<br>';
  }
if((fld.value=="")) {
        fvalid=false;
    message+='Please Upload Image<br>';
       }
	   
if((fld.value!="")) {
// width to resize large images to
var maxWidth=100;
// height to resize large images to
var maxHeight=100;
// valid file types
var fileTypes=["jpg","jpeg","gif"];
// the id of the preview image tag
var outImage="previewField";
// what to display when the image is not valid
var defaultPic="spacer.gif";

/***** DO NOT EDIT BELOW *****/


var source=fld.value;
var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
globalPic=new Image();
if (i<fileTypes.length) globalPic.src=source;
else {
globalPic.src=defaultPic;
fvalid=false;
message+='Please Upload Vaild Image<br>';
}
}

  if (fvalid==true) {
    return true;
  } else {
    document.getElementById('errorMessage').innerHTML=message;
    document.getElementById('errorMessage').style.color='#FF0000';
    return false;
  }
}


<!--Edit category validation-->
function editcat(frm,fld) {
  var message='';
  var fvalid=true;

  if (frm.category1.value=='') {
    fvalid=false;
    message+='Please enter  Category<br>';
  }
  if (frm.description1.value=='') {
    fvalid=false;
    message+='Please enter Discription<br>';
  }

if((fld.value!="")) {
// width to resize large images to
var maxWidth=100;
// height to resize large images to
var maxHeight=100;
// valid file types
var fileTypes=["jpg","jpeg","gif"];
// the id of the preview image tag
var outImage="previewField";
// what to display when the image is not valid
var defaultPic="spacer.gif";

/***** DO NOT EDIT BELOW *****/


var source=fld.value;
var ext=source.substring(source.lastIndexOf(".")+1,source.length).toLowerCase();
for (var i=0; i<fileTypes.length; i++) if (fileTypes[i]==ext) break;
globalPic=new Image();
if (i<fileTypes.length) globalPic.src=source;
else {
globalPic.src=defaultPic;
fvalid=false;
message+='Please Upload Vaild Image<br>';
}
}

  if (fvalid==true) {
    return true;
  } else {
    document.getElementById('errorMessage').innerHTML=message;
    document.getElementById('errorMessage').style.color='#FF0000';
    return false;
  }
}

///subact//

function subcat(frms) {
  var message='';
  var fvalid=true;

  if (frms.category1.value=='') {
    fvalid=false;
    message+='Please enter Sub Category<br>';
  }
/*  if (frm.description1.value=='') {
    fvalid=false;
    message+='Please enter Discription<br>';
  }*/
/*  if (frm.sel.selectedIndex==0) {
    fvalid=false;
    message+='Please Select Age<br>';
  }*/
  if (fvalid==true) {
    return true;
  } else {
    document.getElementById('errorMessage').innerHTML=message;
    document.getElementById('errorMessage').style.color='#FF0000';
    return false;
  }
}

///

///edit subcat///


function subcat1(frms) {
  var message='';
  var fvalid=true;

  if (frms.category1.value=='') {
    fvalid=false;
    message+='Please enter Sub Category<br>';
  }
/*  if (frm.description1.value=='') {
    fvalid=false;
    message+='Please enter Discription<br>';
  }*/
/*  if (frm.sel.selectedIndex==0) {
    fvalid=false;
    message+='Please Select Age<br>';
  }*/
  if (fvalid==true) {
    return true;
  } else {
    document.getElementById('errorMessage').innerHTML=message;
    document.getElementById('errorMessage').style.color='#FF0000';
    return false;
  }
}

//





<!--product validation-->

function validate1(frm1) {
  var message1='';
  var fvalid1=true;

  if (frm1.pname.value=='') {
    fvalid1=false;
    message1+='Please enter Product Name<br>';
  }
  if (frm1.pdes.value=='') {
    fvalid1=false;
    message1+='Please enter Discription<br>';
  }
  
   if (frm1.pqty.value=='') {
    fvalid1=false;
    message1+='Please enter Product Qty<br>';
  }
     

   if (frm1.pqty.value=='') {
    fvalid1=false;
    message1+='Please enter Product Qty<br>';
  }
     




  
  
  
    if (frm1.file.value=='') {
    fvalid1=false;
    message1+='Please Upload Image<br>';
  }
  

  if (fvalid1==true) {
    return true;
  } else {
    document.getElementById('errorMessage1').innerHTML=message1;
    document.getElementById('errorMessage1').style.color='#FF0000';
    return false;
  }
}





<!--edit product validation-->

function edit(frm1) {
  var message1='';
  var fvalid1=true;

  if (frm1.pname.value=='') {
    fvalid1=false;
    message1+='Please enter Product Name<br>';
  }
  if (frm1.pdes.value=='') {
    fvalid1=false;
    message1+='Please enter Discription<br>';
  }
  
   if (frm1.pqty.value=='') {
    fvalid1=false;
    message1+='Please enter Product Qty<br>';
  }
  
  
  
  

  if (fvalid1==true) {
    return true;
  } else {
    document.getElementById('errorMessage1').innerHTML=message1;
    document.getElementById('errorMessage1').style.color='#FF0000';
    return false;
  }
}



/////////admin password//////


function changepass(frm9) {
	
  var message9='';
  var fvalid9=true;

  if (frm9.adminname.value=='') {
    fvalid9=false;
    message9+='Please Enter User Name<br>';
  }
  
    if (frm9.email.value=='') {
    fvalid9=false;
    message9+='Please Enter Admin Email<br>';
  }
  

 
  

  if (fvalid9==true) {
    return true;
  } else {
    document.getElementById('errorMessage9').innerHTML=message9;
    document.getElementById('errorMessage9').style.color='#FF0000';
    return false;
  }
}






/////////////////////password///////////////

function password(frm10) {
	
  var message10='';
  var fvalid10=true;


   if (frm10.new_password.value=='') {
    fvalid10=false;
    message10+='Please Enter Password<br>';
  }
  
  
  
   if (frm10.conpassword.value=='') {
    fvalid10=false;
    message10+='Please Enter Confirm Password<br>';
  }
  
    
   if (frm10.new_password.value!=frm10.conpassword.value) {
	 fvalid10=false;
    message10+='The Password Confirmation must match your new Password.';
  }
  
 

  if (fvalid10==true) {
    return true;
  } else {
    document.getElementById('errorMessage10').innerHTML=message10;
    document.getElementById('errorMessage10').style.color='#FF0000';
    return false;
  }
}


///////////////////////////////////////////////////////


////////////paypal///////////
function paypal(frm11) {
	
  var message11='';
  var fvalid11=true;

  if (frm11.paypalid.value=='') {
    fvalid11=false;
    message11+='Please Enter Paypal Id<br>';
  }


  if (fvalid11==true) {
    return true;
  } else {
    document.getElementById('errorMessage11').innerHTML=message11;
    document.getElementById('errorMessage11').style.color='#FF0000';
    return false;
  }
}

//////////////










