Validate the field that has an earlier date

I'm using google translator.

I have this script, which I use to validate the fields on a form.

  1. /****** Validate ******/
    $("#form_garantia").validate({
    rules: {
    nome: "required",
    telefone: "required",
    email: {required: true, email: true},
    tipo_equipamento: "required",
    localizacao_equipamento: "required",
    data_ocorrencia_falha: "required",
    numero_serie: "required",
    horas_trabalhadas: "required",
    descricao_falha: "required",
    aceite_termos: "required",
    },

    messages: {
    nome: "Informe o nome",
    telefone: "Informe o telefone",
    email: {required: "Informe o e-mail", email: "Informe um e-mail válido"},
    tipo_equipamento: Informe o tipo de equipamento",
    data_ocorrencia_falha: "Informe a data da ocorrência",
    localizacao_equipamento: "Informe a localização do equipamento",
    numero_serie: "Informe o número de série",
    horas_trabalhadas: "Informe as horas trabalhadas",
    descricao_falha: "Informe a descrição da falha",
    aceite_termos: "O aceite não foi clicado"
    }
    });

In the "data_ocorrencia_falha" field, a date prior to the current one may be inserted.
The script does not allow the form to send as it has an error in the "data_ocorrencia_falha" field, asking to put a correct date.
Would it be possible to validate the form, with a date prior to the current one?

Thank you

1 Reply

PM Ponmani Murugaiyan Syncfusion Team May 7, 2021 02:43 PM UTC

Hi davedas, 

Thanks for contacting Syncfusion support. 

From your query we understand that you are facing the validation issue. But we quite unclear about the exact scenario in which you are facing the reported issue. So kindly share the following details.   

  1. For the “data_ocorrencia_falha” filed which control is used in your application.
  2. If suppose you are using DatePicker control, whether providing the input (custom input) as previous date or selecting a date from popup?
  3. Share control rendering code snippet along with that corresponding validation field.
  4. If possible share simple issue replicating sample.

Above requested details will be helpful for us to validate the reported query at our end and provide better solution as early as possible.     

Regards, 
Ponmani M 


Loader.
Up arrow icon