Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.70 KB | None | 0 0
  1. <form method="post" action="//submit.form" onSubmit="return validateForm();">
  2. <div style="width: 100px;">
  3. </div>
  4. <div>
  5. <div style="float:left"><a href="" id="lnk100" title="form to email"></a></div>
  6. <script src="https://www.100forms.com/js/FORMKEY:EBTR2NWCLUZ6" type="text"></script>
  7. </div>
  8. <div style="display: inline-block; text-align: center; padding-bottom: 18px;width : 450px;">
  9. <div style=" margin-left : auto; margin-right : auto; width : 49%;">Nome de Contacto:<br/>
  10. <input type="text" id="data_2" name="data_2" style="width: 100%;" class="form-control"/>
  11. </div>
  12. <div style="display: inline-block; text-align: center; padding-bottom: 18px;width : 450px;">
  13. <div style=" margin-left : auto; margin-right : auto; width : 49%;">E-mail:<br/>
  14. <input type="text" id="data_4" name="data_4" style="width : 100%;" class="form-control"/>
  15. </div>
  16. <div style="display: inline-block; text-align: center; padding-bottom: 18px;width : 450px;">
  17. <div style=" margin-left : auto; margin-right : auto; width : 49%;">Contacto Telefonico:<br/>
  18. <input type="number" id="data_1" name="data_1" style="width : 100%;" class="form-control"/>
  19. </div>
  20. <div style="padding-bottom: 18px;"><input name="skip_Submit" value="Confirmar" type="submit"/></div>
  21. </div>
  22. </div>
  23. </form>
  24.  
  25. <script type="text/javascript">
  26. function validateForm() {
  27. if (!validateEmail(document.getElementById('data_4').value.trim())) {
  28. alert('Email must be a valid email address!');
  29. return false;
  30. }
  31. return true;
  32. }
  33. function isEmpty(str) { return (str.length === 0 || !str.trim()); }
  34. function validateEmail(email) {
  35. var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,15}(?:\.[a-z]{2})?)$/i;
  36. return isEmpty(email) || re.test(email);
  37. }
  38. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement