Results 1 to 10 of 10

Thread: Wordpress Lead Capture

  1. #1
    brechtp is offline Member
    Join Date
    Oct 2007
    Posts
    5

    Unhappy Wordpress Lead Capture

    I have successfully integrated the WebToLead form with my wordpress site with one terrible exception. The email address is not being collected. What I did was
    1. Created a web to lead form with Sugar tool
    2. saved and opened this html file in dreamweaver and stripped out anything style related
    3. Created a new php 'Page' template and saved it to the WP Themes

    Everything works great except the email isn't being captured. I'm sure this has somethign to do with the fact that the email is validated and then probably passed to the post by javascript - I don't know I'm stumped. I've tried moving the javascript around the page, in the head etc, still no dice.

    This is a link to a (mostly) functional form page that I posted http://www.provestre.com/investment-...roperty-videos


    I've pasted the code from the page below, I hope that's not in poor taste for this forum.


    <?php
    /*
    Template Name: 2-4Unit
    */
    ?>
    <?php include('header_about.php'); ?>
    <head>
    <script charset="utf-8" id="injection_graph_func" src="WebToLeadForm_Videos_1202071505_files/injection_graph_func.js">
    </script>
    </head>

    <div id="content_box">


    <div id="content">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
    <h2 style="padding-top: 0;"><?php the_title(); ?></h2>
    <div class="entry">
    <?php the_content('<p class="serif">Read the rest of this page &raquo;</p>'); ?>
    <div class="entry">

    <!-- base href="http://crm.provestre.net/cache/generated_forms/WebToLeadForm_1202071505.html" -->
    <form action="http://crm.provestre.net/WebToLeadCapture.php" name="WebToLeadForm" method="post">
    <table width="510">
    <tbody>
    <tr>
    <td colspan="4"><b>
    <h2>Get more information about these properties</h2>
    </b></td>
    </tr>
    <tr align="center">
    </tr>
    <tr align="left">
    <td colspan="4">Complete this form and we'll get property details to you right away including addresses, financials, and more </td></tr>
    <tr align="center"><td colspan="4"> <br></td></tr>
    <tr>
    <td width="15%"><span sugar="slot">First Name: </span></td>
    <td width="35%">
    <span sugar="slot">
    <input id="first_name" name="first_name" type="text"></span></td>
    </tr>
    <tr>
    <td width="15%">
    <span sugar="slot">Last Name: </span>
    <span class="required" style="color: rgb(255, 0, 0);">*</span></td>
    <td width="35%">
    <span sugar="slot">
    <input id="last_name" name="last_name" type="text"></span></td>
    </tr><tr><td width="15%">
    <span sugar="slot">Email: <span class="required" style="color: rgb(255, 0, 0);">*</span></span></td><td width="35%">
    <span sugar="slot"><input id="webtolead_email1" name="webtolead_email1" onChange="validateEmailAdd();" type="text"></span></td>
    </tr>
    <tr><td width="15%">
    <span sugar="slot">Phone: </span></td><td width="35%"><span sugar="slot">
    <input id="phone_work" name="phone_work" type="text"></span></td>
    </tr>
    <tr>
    <td width="15%"><span sugar="slot">Property: </span></td>
    <td width="35%"><span sugar="slot"><input id="description" name="description" type="text"></span></td>
    </tr>
    <tr>
    <td width="15%"><span sugar="slot"> </span><br></td>
    <td width="35%"><span sugar="slot"> </span><br></td></tr>
    <tr align="center">
    <td colspan="4"> <br></td></tr>
    <tr align="center">
    <td colspan="10">
    <input onClick="check_webtolead_fields();" class="button" name="Submit" value="Submit" type="button"></td></tr>
    <tr><td style="display: none;">
    <input id="campaign_id" name="campaign_id" value="29aa52af-9e29-38a9-6f51-47a626830de7" type="hidden"><br></td></tr><tr><td style="display: none;">
    <input id="redirect_url" name="redirect_url" value="http://www.provestre.com/request-confirmation" type="hidden"><br></td></tr><tr><td style="display: none;">
    <input id="bs_lead_type_c" name="bs_lead_type_c" value="buyer" type="hidden" /><br></td></tr><tr><td style="display: none;">
    <input id="assigned_user_id" name="assigned_user_id" value="a1a01f81-ed07-b564-d425-4773b7f3911d" type="hidden"><br></td></tr><tr><td style="display: none;">
    <input id="req_id" name="req_id" value="last_name;" type="hidden"><br></td>
    </tr>
    </tbody>
    </table>

    </form>
    <div>
    <script type="text/javascript">
    function check_webtolead_fields(){
    if(document.getElementById('bool_id') != null){
    var reqs=document.getElementById('bool_id').value;
    bools = reqs.substring(0,reqs.lastIndexOf(';'))
    var bool_fields = new Array();
    var bool_fields = bools.split(';');
    nbr_fields = bool_fields.length;
    for(var i=0;i<nbr_fields;i++){
    if(document.getElementById(bool_fields[i]).value == 'on'){
    document.getElementById(bool_fields[i]).value = 1;
    }
    else{
    document.getElementById(bool_fields[i]).value = 0;
    }
    }
    }
    if(document.getElementById('req_id') != null){
    var reqs=document.getElementById('req_id').value;
    reqs = reqs.substring(0,reqs.lastIndexOf(';'))
    var req_fields = new Array();
    var req_fields = reqs.split(';');
    nbr_fields = req_fields.length;
    var req = true;
    for(var i=0;i<nbr_fields;i++){
    if(document.getElementById(req_fields[i]).value.length <=0 || document.getElementById(req_fields[i]).value==0){
    req = false;
    break;
    }
    }
    if(req){
    document.WebToLeadForm.submit();
    return true;
    }
    else{
    alert('Please provide all the required fields');
    return false;
    }
    return false
    }
    else{
    document.WebToLeadForm.submit();
    }
    }
    function validateEmailAdd(){
    if(document.getElementById('webtolead_email1').val ue.length >0) {
    if(document.getElementById('webtolead_email1').val ue.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/) == null){
    alert('Not a valid email address');
    }
    }
    if(document.getElementById('webtolead_email2').val ue.length >0) {
    if(document.getElementById('webtolead_email2').val ue.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/) == null){
    alert('Not a valid email address');
    }
    }
    }
    </script>
    </div>
    <?php link_pages('<p><strong>Pages:</strong> ', '</p>', 'number'); ?>
    </div>
    </div>
    <?php endwhile; endif; ?>

    </div>

    <?php get_sidebar(); ?>

    </div>

    <?php get_footer(); ?>

  2. #2
    marcavila is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    10

    Default Re: Wordpress Lead Capture

    Dont think its your validation. I am having the same problem. The webtolead form isnt passing the email address correctly.

    Any idea of how to fix this?

  3. #3
    b.palombo is offline Junior Member
    Join Date
    Feb 2008
    Posts
    1

    Default Re: Wordpress Lead Capture

    Quote Originally Posted by marcavila
    Dont think its your validation. I am having the same problem. The webtolead form isnt passing the email address correctly.

    Any idea of how to fix this?
    I contacted my rep Dan Cronin as I have been working with CE for a while really in preparation to buy Pro and deploy it with my small team.

    Dan set me up with another 30 day pro trial so I could see if this problem was duplicated in the pro version. It was.

    I tried all email fields (i think there are two) in the form and all fields import with the exception of the email fields both in my own installed CE and the PRO version hosted by the Sugar eval site. I tried using the form in a regular html page as opposed to the WordPress php page and in all cases the problem persists.

    Dan says:

    Our Web Form works fine, I have used it myself. What resources did you utilize in setting it up? If you specifically followed all the instructions in the user documentation then there is little more that I can do. I have consulted my team and no one has ever heard of this issue.

    and nobody else has responded to the post.
    I have been working with an independent developer on some tweaks, I had him take a look at this and after some time I had him abandon the project because he was getting into altering the webtolead.php file and I'd rather not be messing with that.

    Any help from the Sugar Team would be greatly appreciated.

  4. #4
    Kasinetz is offline Sugar Team Member
    Join Date
    Mar 2007
    Location
    Atlanta
    Posts
    9

    Default Re: Wordpress Lead Capture

    I believe that this is a bug in the product. Here's an easy fix. Rename the field from webtolead_email1 to email1

    Change:

    <span sugar="slot"><input id="webtolead_email1" name="webtolead_email1" onChange="validateEmailAdd();" type="text"></span></td>

    to

    <span sugar="slot"><input id="email1" name="webtolead_email1" onChange="validateEmailAdd();" type="text"></span></td>

    Also change the validate function

    function validateEmailAdd(){
    if(document.getElementById('email1').value.length >0) {
    if(document.getElementById('email1').value.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/) == null){
    alert('Not a valid email address');
    }

  5. #5
    vdhyani is offline Junior Member
    Join Date
    Dec 2006
    Posts
    143

    Default Re: Wordpress Lead Capture

    This issue has already been resolved and will be shipped in 500b very soon. However, if you want to fix in the meantime then modify the WebToLeadCapture.php file:

    Replace evrything inside the following if condition :
    if(isset($_POST['webtolead_email1']) && $_POST['webtolead_email1'] != null){

    }

    with
    $lead->email1 = $_POST['webtolead_email1'];


    Do the same for if(isset($_POST['webtolead_email2']) && $_POST['webtolead_email2'] != null){ // } and replace everything inside the if condition with
    $lead->email2 = $_POST['webtolead_email2'];

  6. #6
    marcavila is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    10

    Default Re: Wordpress Lead Capture

    Neither of these methods seems to work. Ive tried both. Anyone have any luck. Any idea when the b release is coming out?

    thanks,
    -Marc

  7. #7
    marcavila is offline Sugar Community Member
    Join Date
    Sep 2007
    Posts
    10

    Default Re: Wordpress Lead Capture

    I believe that this is a bug in the product. Here's an easy fix. Rename the field from webtolead_email1 to email1

    Change:

    <span sugar="slot"><input id="webtolead_email1" name="webtolead_email1" onChange="validateEmailAdd();" type="text"></span></td>

    to

    <span sugar="slot"><input id="email1" name="webtolead_email1" onChange="validateEmailAdd();" type="text"></span></td>

    Also change the validate function

    function validateEmailAdd(){
    if(document.getElementById('email1').value.length >0) {
    if(document.getElementById('email1').value.match(/^\w+(['\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/) == null){
    alert('Not a valid email address');
    }
    Actually there was an error in this one.

    Code:
    <input id="email1" name="webtolead_email1" onChange="validateEmailAdd();" type="text">
    should be

    Code:
    <input id="email1" name="email1" onChange="validateEmailAdd();" type="text">

  8. #8
    GazRideGuide is offline Junior Member
    Join Date
    Apr 2008
    Posts
    2

    Default Re: Wordpress Lead Capture

    Thank you folks - saved my life - I changed the name and id from webtolead_email1 to email1 in the form and in the javascript and hey presto - works loverly.

  9. #9
    kuske's Avatar
    kuske is offline Sugar Community Member
    Join Date
    Oct 2007
    Location
    Germany
    Posts
    2,597

    Default Re: Wordpress Lead Capture

    I tried to reach the address http://crm.provestre.net/ you used in your web_to_lead form.
    This address is not reacheable.
    Perhaps you have a dns problem and should use http://crm.provestre.com/ instead.
    Attached Images Attached Images  

  10. #10
    monkeyfish is offline Sugar Community Member
    Join Date
    Mar 2008
    Posts
    29

    Default Re: Wordpress Lead Capture

    I've tried to use this code in Wordpress without creating the new page template by using the < code > tag around the javascript. However, the form doesn't work after the page is saved because it changes the javascript.

    This is what happends to some of my code when saving it in Wordpress 2.5:

    function validateEmailAdd(){
    if(document.getElementById('webtolead_email1').val ue.length >0) {
    if(document.getElementById(’webtolead_email1′).val ue.match(/^\w+([’\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/) == null){
    alert(’Not a valid email address’);
    }
    }
    if(document.getElementById(’webtolead_email2′).val ue.length >0) {
    if(document.getElementById(’webtolead_email2′).val ue.match(/^\w+([’\.\-\+]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/) == null){
    alert(’Not a valid email address’);

    -------------------------
    I am assuming that this is why you created the new page template. Is that the only way to fix it?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 2009-10-23, 02:41 PM
  2. HOWTO: Edit a Campaign Lead Capture Form?
    By baigeman in forum Help
    Replies: 3
    Last Post: 2007-12-11, 04:46 AM
  3. Need help with Lead capture
    By trey5498 in forum Installation and Upgrade Help
    Replies: 0
    Last Post: 2007-01-24, 04:25 PM
  4. Online Lead Capture and Self Service Portal
    By cehrenthal in forum General Discussion
    Replies: 7
    Last Post: 2006-10-23, 02:21 AM
  5. From lead to order
    By george_bbch in forum Feature Requests
    Replies: 0
    Last Post: 2006-09-26, 02:02 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •