eMail validation in form filled from data tables
eMail validation in form filled from data tables
Hello,
I am chasing the answer everywhere.
I am building a form with datatables. It is very cool I click on a line in the datatable and the form fills automatically
So far soo good.
But If I want to be sure the email in the form is correct? or at least that it has a @ in it, the HTML5 doesn't work in the form, actually because there is no FORM as dataTables doesn't take FORM...
So How can I do?
I could send some code,
var eMail="";
function ut_chk_mail() {
var eMail=$("#ut_t_email").val()
var ut_chk_mail = /^[a-zA-Z0–9.!#$%&’*+\/=?^_`{|}~-]+@[a-zA-Z0–9](?:[a-zA-Z0–9-]{0,61} [a-zA-Z0–9])?(?:\.[a-zA-Z0–9](?:[a-zA-Z0–9-]{0,61}[a-zA-Z0–9])?)*$/;
if(ut_chk_mail.test(eMail))
alert("Votre eMail semble correct");
else
alert("Ce n'est pas un eMail, SVP valider encore.");
}
It actually gives the else alert no matter what I write and then it is added to the data base
Answers
Hi @MartinLissJohansson ,
That sounds more like a generic Javascript question, rather than anything specific to DataTables. It would be worth asking on a site like StackOverflow.
Cheers,
Colin
THX,
I asked here because it is because using datatables the HTML 5 type="email" doesn't work...
i will keep searching.
Cheers Colin
I don't really understand what using a table with type="email" means. Can you link to a page showing the issue please?
Allan