Results 1 to 4 of 4

Thread: View First Unread

  1. #1
    linzhixua34 is offline Junior Member
    Join Date
    Apr 2008
    Posts
    3

    Default View First Unread

    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
    Created a web to lead form with Sugar tool
    saved and opened this html file in dreamweaver and stripped out anything style related
    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.


    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(); ?>

    Last edited by susiewilliams; 2008-04-25 at 05:47 PM.

  2. #2
    clint's Avatar
    clint is offline Sugar Team Member | Forums Lead Moderator
    Join Date
    Aug 2004
    Location
    Silicon Valley
    Posts
    2,120

    Default Re: View First Unread

    I am really confused by these posts from linzhixua34. Are they spam or not? What do you all think?
    Sugar Developer Zone - developer resources | Sugar University - user and admin training
    Sugar Docs - user and admin documentation |
    Sugar Bug Tracker - Enter or view bugs
    SugarForge- open source modules, themes, lang packs | SugarExchange - commercial extensions

    Clint Oram
    Chief Technology Officer and Co-founder
    SugarCRM

  3. #3
    lynn1804 is offline Sugar Community Member
    Join Date
    Dec 2006
    Location
    Ipswich, United Kingdom
    Posts
    20

    Default Re: View First Unread

    For it to capture email information you must use "email1" as the field name rather than "webtolead_email1"

  4. #4
    Join Date
    Feb 2007
    Location
    San Jose, CA
    Posts
    1,169

    Default Re: View First Unread

    To answer Clint's question, I think they are spam mixed in with some actual information. I've taken the liberty to remove the spam portions, leaving the good stuff intact.

    This isn't the first time we have seen something like this (and likely won't be the last).
    Susie Williams

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 23
    Last Post: 2010-11-11, 08:31 AM
  2. Replies: 13
    Last Post: 2007-10-04, 05:53 AM
  3. Replies: 0
    Last Post: 2007-08-09, 06:34 PM
  4. Replies: 0
    Last Post: 2006-01-14, 04:23 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
  •