Validate the date format
Validate the date format
klermann
Posts: 277Questions: 67Answers: 1
How can Ivalidate the date format here here? I'm trying like this:
editor.on( 'preSubmit', function ( e, o, action ) {
if(!dataReceita.format: "DD/MM/YYYY"){
dataReceita.error("Insira uma data válida!");
}
}
} );
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
What you need is some kind of regex validation, as I think is (still) not available in DataTables.I don't know if you are using some kind of framework like i.e. Codeigniter. I don't use the validation of Datatables, but my own ones (in this case with Codeigniter).
Maybe I am totally wrong as I am new to Datatables also.
Receiving an Ajax request I check the $_POST for the kind of operation; read, update, insert or delete. In case of an insert or update I call form my own validation rules. This more or less how I am trying to resolve my issues. Quando precisa mais detalhes posse lhe dar. I am speaking Portuguese also
Forget my answer as you were asking for a pre-submit validation.
I would suggest you use MomentJS's
isValid()
function.Allan