title: Email RegEx Javascript with RPC
body: <p>I have a few codes here of js. And I wanted to put a validation for email and prevents user from submitting a form when it is not valid. Please bear with me since I am new with this technology. Thank you for understanding :)</p>
  <pre><code>var session = require('web.session');
  var db_name = $(&quot;input[name='partner_name']&quot;).val();
  var contact = $(&quot;input[name='contact_name']&quot;).val();
  var email = $(&quot;input[name='email_from']&quot;).val();
  var url = '/page/website_crm.contactus_thanks';
  
  
   $(function(){
          $(&quot;#start_trial&quot;).click(function(){ // no idea how to put email validation here
                      session.rpc('/custom/createaccount', {                      
                              db_name : db_name, 
                              contact_name: contact, 
                              email_from: email
                          });
                      }).then(function () {
                          console.log(&quot;Creating user account&quot;)
                      });
                      
                     // that won't proceed here
                      setTimeout(function (){
                         window.location = url;
                      }, 5000);
  
  });
  </code></pre>