This is a migrated thread and some comments may be shown as answers.

salesforce web to lead form nested

0 Answers 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Amar
Top achievements
Rank 1
Amar asked on 20 Feb 2018, 12:10 PM

Hi,

I'm trying to insert a Salesforce Web-to-lead form into a page on our external website's CMS (we use Telerik if that makes a difference) using a plain old Content Block control. Unfortunately, when the page gets rendered, creates its own tag that wraps around the Salesforce-generated code and therefore creates a nested form. That obviously doesn't work.

Has anyone come up with a solution to a problem like this? I've looked at other nested form solutions and not seen one like this. The others all seem to imply a lot more control over the code that I do not have with (our SF instance was developed externally and all we have to work with is the CMS side of things).

The one thing I've tried that "sort of" works but is poor coding practice is to put an empty set of form tags right before the Salesforce-generated code. But then the page doesn't use the return URL, and just lists the fields that have been queued for insertion into our Leads object in our SF org.

Here's the Web-to-lead code I'm inserting (plus the bad-practice empty form):

<form></form>
<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: Please add the following <META> element to your page <HEAD>.      -->
<!--  If necessary, please modify the charset parameter to specify the        -->
<!--  character set of your HTML page.                                        -->
<!--  ----------------------------------------------------------------------  -->
<!-- <META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"> -->
<!--  ----------------------------------------------------------------------  -->
<!--  NOTE: Please add the following <FORM> element to your page.             -->
<!--  ----------------------------------------------------------------------  -->
<form id="sf_lead_entry" action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
    <input name="oid" type="hidden" value="<org id>" />
    <input name="retURL" type="hidden" value="https://uat.collegeadvantage.com/529intheworkplace/thank-you" />
    <!--  ----------------------------------------------------------------------  -->
    <!--  NOTE: These fields are optional debugging elements. Please uncomment    -->
    <!--  these lines if you wish to test in debug mode.                          -->
    <input name="debug" type="hidden" value="1" />
    <input name="debugEmail" type="hidden" value="software@collegeadvantage.com" />
    <!--  ----------------------------------------------------------------------  -->
    <label for="first_name">First Name</label><input name="first_name" id="first_name" type="text" size="20" maxlength="40" /><br />
    <label for="last_name">Last Name</label><input name="last_name" id="last_name" type="text" size="20" maxlength="80" /><br />
    <label for="company">Company</label><input name="company" id="company" type="text" size="20" maxlength="40" /><br />
    <label for="title">Title</label><input name="title" id="title" type="text" size="20" maxlength="40" /><br />
    <label for="phone">Phone</label><input name="phone" id="phone" type="text" size="20" maxlength="40" /><br />
    <label for="email">Email</label><input name="email" id="email" type="text" size="20" maxlength="80" /><br />
    <label for="street">Street</label><textarea name="street"></textarea><br />
    <label for="city">City</label><input name="city" id="city" type="text" size="20" maxlength="40" /><br />
    <label for="state">State/Province</label><input name="state" id="state" type="text" size="20" maxlength="20" /><br />
    <label for="zip">Zip</label><input name="zip" id="zip" type="text" size="20" maxlength="20" /><br />
    Lead Channel:<textarea name="<custom control id>" id="<custom control id>" wrap="soft" type="text"></textarea><br />
    <input name="submit" type="submit" value="Submit Query" />
</form>
Does anyone have any ways around this?

Thank you

Tags
General Discussions
Asked by
Amar
Top achievements
Rank 1
Share this question
or