Advertisement
adsleeblythe

Validate standard/custom Salesforce web-to-lead forms

Dec 18th, 2012
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // JavaScript Document
  2. function validation(form) {
  3.      
  4.      
  5. if(form.first_name.value == '') {
  6.  
  7. alert('Please enter your first name');
  8. form.first_name.focus();
  9. return false;
  10. }
  11.  
  12. if(form.last_name.value == '') {
  13.  
  14. alert('Please enter your last name');
  15. form.last_name.focus();
  16. return false;
  17. }
  18.  
  19. if(form.email.value == '') {
  20.  
  21. alert('Please enter your email address');
  22. form.email.focus();
  23. return false;
  24. }
  25.  
  26. if(form.company.value == '') {
  27.  
  28. alert('Please enter your company');
  29. form.company.focus();
  30. return false;
  31. }
  32.  
  33. var chooselocation = document.getElementById('00ND0000004qjQL');
  34. if(chooselocation.value == '') {
  35.   alert('Please select a location');
  36.   chooselocation.focus();
  37.   return false;
  38. }
  39.  
  40. var comment = document.getElementById('00ND0000004oVyD');
  41. if(comment.value == '') {
  42.   alert('Please enter a message');
  43.   comment.focus();
  44.   return false;
  45. }
  46.  
  47. return true;
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement