Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

107
Views
Cómo verificar si la entrada coincide con un patrón de cadena con jQuery

Mi objetivo es verificar si un campo de entrada de correo electrónico (cuando un usuario escribe caracteres en él), coincide con un patrón o no. Este es mi ejemplo de trabajo hasta ahora, pero me siento atascado cuando llega al punto de hacer coincidir el proceso "mientras" escribe...

A continuación se muestra mi ejemplo de trabajo que estoy tratando de capitalizar ...

 //... var $attemail = mtarget.find(".my-email-field"); //INPUT function validateEmail(email) { var re = /\S+@\S+\.\S+/; if (re.test(email) == false) { console.log('Email field is not valid'); //issueFlag.push(noticeEmail); } } function checkEmailOnType() { $attemail.on("input", function(){ var $characters = jQuer(this).val(); if ($characters.toLowerCase()) { //IF MY CHARACTER TYPING IS PASSING OR NOT PASSING //MY validateEmail() FUNCTION ABOVE, HOW DO WE SAY THAT? } }); } //...
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Agregue un valor de retorno a su función. Yours as is devuelve undefined , que puede cambiar para devolver el resultado de re.test(email) .

 //... var $attemail = mtarget.find(".my-email-field"); //INPUT function validateEmail(email) { var re = /\S+@\S+\.\S+/; return re.test(email) } //function checkEmailOnType() { $attemail.on("input", function(){ var $characters = jQuer(this).val(); if ($characters.toLowerCase()) { //IF MY CHARACTER TYPING IS PASSING OR NOT PASSING //MY validateEmail() FUNCTION ABOVE, HOW DO WE SAY THAT? if(validateEmail($characters) == false){ console.log('Email field is not valid') } } }); //} //...
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!