Advertisement
martyychang

Web-to-Lead with JavaScript Spam Countermeasure

May 9th, 2014
248
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 2.89 KB | None | 0 0
  1. <html>
  2. <head>
  3.   <!--  ----------------------------------------------------------------------  -->
  4.   <!--  NOTE: Please add the following <META> element to your page <HEAD>.      -->
  5.   <!--  If necessary, please modify the charset parameter to specify the        -->
  6.   <!--  character set of your HTML page.                                        -->
  7.   <!--  ----------------------------------------------------------------------  -->
  8.  
  9.   <META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">
  10.   <script>
  11.     /*
  12.      * Function created specifically to set the Organization ID
  13.      * pseudo-dynamically to prevent simple spam
  14.      */
  15.     function setOid() {
  16.       document.getElementsByName("oid")[0].value = "YOUR_ORGANIZATION_ID";
  17.     }
  18.   </script>
  19. </head>
  20. <body>
  21.   <!--  ----------------------------------------------------------------------  -->
  22.   <!--  NOTE: Please add the following <FORM> element to your page.             -->
  23.   <!--  NOTE: The form was modified to include an onsubmit attribute            -->
  24.   <!--  ----------------------------------------------------------------------  -->
  25.  
  26.   <form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST" onsubmit="setOid()">
  27.  
  28.   <!--  ----------------------------------------------------------------------  -->
  29.   <!-- NOTE: This field value was removed for demo purposes, because we are     -->
  30.   <!-- replacing it with a blank value that is instead set when the user        -->
  31.   <!-- submits the form                                                         -->
  32.   <!-- <input type=hidden name="oid" value="YOUR_ORGANIZATION_ID">                   -->
  33.   <!--  ----------------------------------------------------------------------  -->
  34.   <input type=hidden name="oid">
  35.   <input type=hidden name="retURL" value="http://salesforce.com">
  36.  
  37.   <!--  ----------------------------------------------------------------------  -->
  38.   <!--  NOTE: These fields are optional debugging elements. Please uncomment    -->
  39.   <!--  these lines if you wish to test in debug mode.                          -->
  40.   <!--  <input type="hidden" name="debug" value=1>                              -->
  41.   <!--  <input type="hidden" name="debugEmail" value="martyc@slalom.com">       -->
  42.   <!--  ----------------------------------------------------------------------  -->
  43.  
  44.   <label for="first_name">First Name</label><input  id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
  45.  
  46.   <label for="last_name">Last Name</label><input  id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
  47.  
  48.   <label for="email">Email</label><input  id="email" maxlength="80" name="email" size="20" type="text" /><br>
  49.  
  50.   <label for="company">Company</label><input  id="company" maxlength="40" name="company" size="20" type="text" /><br>
  51.  
  52.   <input type="submit" name="submit">
  53.  
  54.   </form>
  55. </body>
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement