Subversion Repositories SmartDukaan

Rev

Rev 21826 | Rev 21830 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

function associateValidator(){
    $('#form').bootstrapValidator({
        fields: {
                registeredBusinessName: {
                validators: {
                    
                        notEmpty: {
                        message: 'Please fill the BusinessName'
                    }
                }
            },

    
            registeredAddress1: {
                validators: {
                   
                    notEmpty: {
                        message: 'Please fill the Address field.'
                    }
                }
            },
            city: {
                validators: {
                  
                    notEmpty: {
                        message: 'Please fill the city '
                    }
                }
            },

             pincode: {
                validators: {
                    notEmpty: {
                        message: 'Please fill your pincode'
                    },
                   
                }
            },

           state: {
                validators: {
                    notEmpty: {
                        message: 'Please select your state'
                    }
                }
            },
Landline: {
                validators: {
                    stringLength: {
                       max: 10,
                    },
                    notEmpty: {
                        message: 'Pleasefill your phone number'
                    },
                   
                    }
                },

                mobile: {
                validators: {
                    stringLength: {
                       max: 10,
                    },
                    notEmpty: {
                        message: 'Please fill your Mobile'
                    },
             
                    }
                },
                registeredEmail1: {
                validators: {
                    notEmpty: {
                        message: 'Please fill your email address'
                    },
                    emailAddress: {
                        message: 'Please fill a valid email address'
                    }
                }
            },

            registeredEmail2:{
               validators: {
                  
                    emailAddress: {
                        message: 'Please fill valid email address'
                    }
                }
            },

            dinNumber:{
              validators:{
                 notEmpty: {
                        message: 'Please fill the DINumber'
                    }
                }
            },
          

                            bEntityDoc:{
                
                               validators: {
                                          file: {
                          //extension: 'pdf,zip,rtf,jpg,png',
                         //type: 'application/pdf,application/zip,application/jpg,application.png'
                             
                    },
                    notEmpty: {
                                    message: 'Document is required.'
                              }
                    }
                  },
                
                
                  angleDoc1:{
                
                               validators: {
                                          file: {
                         // extension: 'pdf,zip,rtf,jpg,png',
                         // type: 'application/pdf,application/zip,application/jpg,application.png'
                             
                    },
                    notEmpty: {
                                    message: 'Document is required.'
                              }
                    }
                  },
                
                  angleDoc2:{
                
                               validators: {
                                          file: {
                         // extension: 'pdf,zip,rtf,jpg,png',
                         // type: 'application/pdf,application/zip,application/jpg,application.png'
                       
                    },
                    notEmpty: {
                                    message: 'Document is required.'
                              }
                    }
                  },
                        angleDoc3:{
                        
                                       validators: {
                                                  file: {
                                 // extension: 'pdf,zip,rtf,jpg,png',
                                  //type: 'application/pdf,application/zip,application/jpg,application.png'
                                     
                            },
                            notEmpty: {
                    message: 'Document is required.'
              }
                                    }
                                  },
                                angleDoc4:{

               validators: {
                          file: {
          //extension: 'pdf,zip,rtf,jpg,png',
         // type: 'application/pdf,application/zip,application/jpg,application.png'
             
                            },
                            notEmpty: {
                                            message: 'Document is required.'
                                      }
                            }
                          },
                                    
                        angleDoc5:{
                          validators: {
                                                  file: {
                                  //extension: 'pdf,zip,rtf,jpg,png',
                                  //type: 'application/pdf,application/zip,application/jpg,application.png'
                                     
                            },
                                        notEmpty: {
                    message: 'Document is required.'
              }
               }
              },

            pan:{
              validators:{

                      stringLength: {
                       max: 10,
                    },
                notEmpty:{
                  message:'Please fill the valid pan Number'
                }

              }
            },

            panDoc:{

               validators: {
                          file: {
          //extension: 'pdf,zip,rtf,jpg,png',
          //type: 'application/pdf,application/zip,application/jpg,application.png'
             
    },
    notEmpty: {
                    message: 'Pan card Document is required.'
              }
    }
  },
  proprietorBusineesName:{
                 validators:{

                notEmpty:{
                  message:'Please fill the field'
                }

              }
            },
            proprietorAddress:{
             validators:{
                notEmpty:{
                  message:'Please fill the field'
                }

              }
            }, 

            proprietorPhone:{
                validators:{

                 stringLength: {
                       max: 10,
                    },
                   notEmpty:{
                  message:'Please fill the field'
                }

              } 
          },   
          proprietorPan:{
              validators:{

             stringLength: {
                       max: 10,
                    },
                  notEmpty:{
                  message:'Please fill the field'
                }

              } 
        },
        proprietorAdhaar:{
             validators:{

            notEmpty:{
                  message:'Please fill the field'
                }

              }  
          },

          proprietorEmail:{
             validators: {
                    notEmpty: {
                        message: 'Please fill the field'
                    },
                    emailAddress: {
                        message: 'Please fill a valid email address'
                    }
                }
            },

            proprietorOwner:{
           validators:{
              stringLength: {
                       max: 10,
                    },
            notEmpty:{
                  message:'Please fill the field'
                }

              } 
            },

            partnerName1:{
                 validators:{

                notEmpty:{
                  message:'Please fill the field'
                }

              }
            },
            partnerAddress1:{
            validators:{
                notEmpty:{
                  message:'Please fill the field'
                }

              }
            }, 

            partnerPhone1:{
                 validators:{
                 stringLength: {
                       max: 10,
                    },
                   notEmpty:{
                  message:'Please fill the field'
                }

              } 
          },   
          partnerPan1:{
            validators:{
             stringLength: {
                       max: 10,
                    },
                  notEmpty:{
                  message:'Please fill the field'
                }

              } 
        },
        partnerAdhaar1:{
             validators:{

            notEmpty:{
                  message:'Please fill the field'
                }

              }  
          },

          partnerEmail1:{
             validators: {
                    notEmpty: {
                        message: 'Please fill the field'
                    },
                    emailAddress: {
                        message: 'Please fill a valid email address'
                    }
                }
            },

            partnerOwner1:{
           validators:{
              stringLength: {
                       max: 10,
                    },
            notEmpty:{
                  message:'Please fill the field'
                }

              } 
            },
        


            shareholderName1:{
                 validators:{

                notEmpty:{
                  message:'Please fill the field'
                }

              }
            },
            shareholderAddress1:{
            validators:{
                notEmpty:{
                  message:'Please fill the field'
                }

              }
            }, 

            shareholderPhone1:{
                 validators:{
                 stringLength: {
                       max: 10,
                    },
                   notEmpty:{
                  message:'Please fill the field'
                }

              } 
          },   
     shareholderPan1:{
             validators:{
             stringLength: {
                       max: 10,
                    },
                  notEmpty:{
                  message:'Please fill the field'
                }

              } 
        },
        shareholderAdhaar1:{
             validators:{

            notEmpty:{
                  message:'Please fill the field'
                }

              }  
          },

          shareholderEmail1:{
             validators: {
                    notEmpty: {
                        message: 'Please fill the field'
                    },
                    emailAddress: {
                        message: 'Please fill a valid email address'
                    }
                }
            },

            shareholderOwner1:{
           validators:{
              stringLength: {
                       max: 10,
                    },
            notEmpty:{
                  message:'Please fill the field'
                }

              } 
            },
            managerName: {
                validators: {
                    
                        notEmpty: {
                        message: 'Please fill the ManagerName'
                    }
                }
            },
            
            managerNo:{
                 validators:{
                 stringLength: {
                       max: 10,
                    },
                   notEmpty:{
                  message:'Please fill the ManagerNo'
                }

              } 
          },

          managerEmail:{
            validators: {
                    notEmpty: {
                        message: 'Please fill the Manageremail'
                    },
                    emailAddress: {
                        message: 'Please fill a valid email address'
                    }
                }
            },
            noOfEmployees:{
                validators:{
                   notEmpty:{
                  message:'Please fill the Number of employees'
                }
            }},
            managementStaff:{
               validators:{
                   notEmpty:{
                  message:'Please fill the  Number of Managementstaff'
                }
            }
        },

        itrDoc:{

               validators: {
                          file: {
                          extension: 'pdf,zip,rtf,jpg,png',
                          type: 'application/pdf,application/zip,application/jpg,application.png'
                             
                    },
                    notEmpty: {
                                    message: 'ITR Document is required.'
                              }
                    }
                  },

                          ownershipDoc:{
                             validators: {
                                                  file: {
                                  //extension: 'pdf,zip,rtf,jpg,png',
                                  //type: 'application/pdf,application/zip,application/jpg,application.png'
                                     
                            },
                            notEmpty: {
                                            message: 'Ownership Document is required.'
                                      }
                            }
                        },
                        
                        insuranceDoc:{
                             validators: {
                                                  file: {
                                //  extension: 'pdf,zip,rtf,jpg,png',
                                 // type: 'application/pdf,application/zip,application/jpg,application.png'
                                     
                            },
                            notEmpty: {
                                            message: 'Insurance Document is required.'
                                      }
                            }
                        },
                        loanDoc:{
                             validators: {
                                                  file: {
                                 // extension: 'pdf,zip,rtf,jpg,png',
                                  //type: 'application/pdf,application/zip,application/jpg,application.png'
                                     
                            },
                            notEmpty: {
                                            message: 'Document is required.'
                                      }
                            }
                        },
                        sanctionDoc:{
                             validators: {
                                                  file: {
                                 // extension: 'pdf,zip,rtf,jpg,png',
                                 // type: 'application/pdf,application/zip,application/jpg,application.png'
                                     
                            },
                            notEmpty: {
                                            message: 'Document is required.'
                                      }
                            }
                        },
                        
                        chequeCopy:{
                             validators: {
                                                  file: {
                                 // extension: 'pdf,zip,rtf,jpg,png',
                                 // type: 'application/pdf,application/zip,application/jpg,application.png'
                                     
                            },
                            notEmpty: {
                                            message: 'Document is required.'
                                      }
                            }
                        },

        portalName1:{
             validators:{
                   notEmpty:{
                  message:'Please fill the PortalName'
                }
            }
        },
       east:{
         validators:{
                   notEmpty:{
                  message:'Please fill the Area'
                }
            }
        },
        west:{
         validators:{
                   notEmpty:{
                  message:'Please fill the Area'
                }
            }
        },
        north:{
         validators:{
                   notEmpty:{
                  message:'Please fill the Area'
                }
            }
        },

     south:{
         validators:{
                   notEmpty:{
                  message:'Please fill the Area'
                }
            }
        },

        front:{
         validators:{
                   notEmpty:{
                  message:'Please fill the Area'
                }
            }
        },

        roadSize:{
         validators:{
                   notEmpty:{
                  message:'Please fill the Area'
                }
            }
        },
        storeName:{
            validators:{
                   notEmpty:{
                  message:'Please fill the storename'
                }
            }
        },

        storeAddress:{
            validators:{
                   notEmpty:{
                  message:'Please fill the storeAddress'
                }
            }
        }, 

        accountNumber:{
            validators:{
                   notEmpty:{
                  message:'Please fill the accountnumber'
                }
            }
        },  
        bankName:{
            validators:{
                   notEmpty:{
                  message:'Please fill the bankname'
                }
            }
        },  
        ifscCode:{
            validators:{
                   notEmpty:{
                  message:'Please fill the IFSCcode'
                }
            }
        }, 
        branchName:{
            validators:{
                   notEmpty:{
                  message:'Please fill the Branchname'
                }
            }
        },

        utr:{
           validators:{
                   notEmpty:{
                  message:'Please fill the field'
                }
            }
        }



         
        
            }
        }).on('success.form.bv', function(e) {
                $('#form').data('bootstrapValidator').resetForm();

            // Prevent form submission
            e.preventDefault();

            // Get the form instance
            var $form = $(e.target);

            // Get the BootstrapValidator instance
            var bv = $form.data('bootstrapValidator');

            // Use Ajax to submit form data
 var isChecked = jQuery("input[name=bEntity]:checked").val();
      if(!isChecked){
         alert('Please select the type of BusinessEntity');
         return false;
     }else{
         
}
     var isChecked = jQuery("input[name=bPmpDetail]:checked").val();
      if(!isChecked){
         alert('Please select the detail of BusinessEntity');
          return false;
     }else{
         
     }

       var isChecked = jQuery("input[name=businessModel]:checked").val();
      if(!isChecked){
         alert('Please select the BusinessModel');
          return false;
     }else{
         }

        var isChecked = jQuery("input[name=sellingOnline]:checked").val();
      if(!isChecked){
          alert('Please select the Sellingonline');
           return false;
     }else{
         }

    var isChecked = jQuery("input[name=shopArea]:checked").val();
      if(!isChecked){
          alert('Please select the shopArea');
           return false;
     }else{
         }

   var isChecked = jQuery("input[name=shopStatus]:checked").val();
      if(!isChecked){
          alert('Please select the shopstatus');
           return false;
     }else{
         }
         

            var isChecked = jQuery("input[name=shopAvailbility]:checked").val();
      if(!isChecked){
          alert('Please select the shopAvailbility');
           return false;
     }else{
         }

              var isChecked = jQuery("input[name=location]:checked").val();
      if(!isChecked){
          alert('Please select the Loacation of Shop');
           return false;
     }else{
         }


         var isChecked = jQuery("input[name=nearestStore]:checked").val();
      if(!isChecked){
          alert('Please select the NearestStore');
           return false;
     }else{
         }

      var isChecked = jQuery("input[name=ownership]:checked").val();
if(!isChecked){
  alert('Please select the ownership of Shop');
   return false;
}else{
 }

            var isChecked = jQuery("input[name=insurance]:checked").val();
      if(!isChecked){
          alert('Please select the Insurance field');
           return false;
     }else{
         }

     var isChecked = jQuery("input[name=loan]:checked").val();
      if(!isChecked){
          alert('Please select the loan field');
           return false;
     }else{
         }
 var isChecked = jQuery("input[type=checkbox]:checked").val();
      if(!isChecked){
          alert('Please select the Status of shop');
           return false;
     }
      formData = new FormData($(this)[0]);
      
      jQuery.ajax({
          url: "register",
          type: 'POST',
          data: formData,
          async: false,
          beforeSend: function(){
              $('#ajax-spinner').show();
          },
          complete: function(){
              $('#ajax-spinner').hide();
          },
          success: function (data) {
              alert("ThankYou for the registration.Out team will contact you soon.");
              $('#form')[0].reset();
          },
                 error : function() {
                        alert("OOPS!!!Failed to do changes.Try Again.");
                 },
          cache: false,
          contentType: false,
          processData: false
      });
});
}