Posted By

Butterflyland on 08/11/07


Tagged


Versions (?)

My Javascript


 / Published in: JavaScript
 

This is my current code

  1. if ( posRegard.value == "" || whiteSpace.test(posRegard.value) ) {
  2. document.getElementById("emailSuccess").style.display = "none";
  3. hideAllErrors();
  4. document.getElementById("regardError").style.display = "inline";
  5. document.getElementById("posRegard").select();
  6. document.getElementById("posRegard").focus();
  7. } else if ( posName.value == "" || whiteSpace.test(posName.value) ) {
  8. document.getElementById("emailSuccess").style.display = "none";
  9. hideAllErrors();
  10. document.getElementById("nameError").style.display = "inline";
  11. document.getElementById("posName").select();
  12. document.getElementById("posName").focus();
  13. } else if ( posEmail.value == "" || whiteSpace.test(posEmail.value) ) {
  14. document.getElementById("emailSuccess").style.display = "none";
  15. hideAllErrors();
  16. document.getElementById("emailError1").style.display = "inline";
  17. document.getElementById("posEmail").select();
  18. document.getElementById("posEmail").focus();
  19. } else if ( (posEmail.value !="") && (!posEmail.value.match(emailFormat)) ) {
  20. document.getElementById("emailSuccess").style.display = "none";
  21. hideAllErrors();
  22. document.getElementById("emailError2").style.display = "inline";
  23. document.getElementById("posEmail").select();
  24. document.getElementById("posEmail").focus();
  25.  
  26. } else if ( posEmail.value == '' && strCC.checked == true ) {
  27. document.getElementById("emailSuccess").style.display = "none";
  28. hideAllErrors();
  29. document.getElementById("ccError").style.display = "inline";
  30. document.getElementById("selfCC").select();
  31. document.getElementById("selfCC").focus();
  32. } else if ( posText.value == "" || whiteSpace.test(posText.value) ) {
  33. document.getElementById("emailSuccess").style.display = "none";
  34. hideAllErrors();
  35. document.getElementById("messageError").style.display = "inline";
  36. document.getElementById("posText").select();
  37. document.getElementById("posText").focus();
  38. } else {
  39. hideAllErrors();
  40. sendPosEmail();
  41. }
  42. }

Report this snippet  

You need to login to post a comment.