You need to sign in to do that
Don't have an account?

Convert Web to Lead form to Visualforce for Sites
Hi All,
I am trying to use sites to post my web to lead form.Is it possible to convert below html code to visualforce Any help plz. Below is my web to lead form
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name="oid" value="00DT0000000KVU">
<input type=hidden name="retURL" value="http://">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: These fields are optional debugging elements. Please uncomment -->
<!-- these lines if you wish to test in debug mode. -->
<!-- <input type="hidden" name="debug" value=1> -->
<!-- <input type="hidden" name="debugEmail" -->
<!-- value="sai@sftech.com"> -->
<!-- ---------------------------------------------------------------------- -->
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>
<label for="email">Email</label><input id="email" maxlength="80" name="email" size="20" type="text" /><br>
<label for="company">Company</label><input id="company" maxlength="40" name="company" size="20" type="text" /><br>
<label for="city">City</label><input id="city" maxlength="40" name="city" size="20" type="text" /><br>
<label for="state">State/Province</label><input id="state" maxlength="20" name="state" size="20" type="text" /><br>
<input type="submit" name="submit">
</form>
Thanks
<input type="hidden" name="oid" value="00DT0000000KVU" />
<input type="hidden" name="retURL" value="http://" />
Do the same for your last input tag too, make sure you end your input tag with a, />
Thanks.
All Answers
Hi,
All you have to do is, include your html form inside a visualforce page like this,
<apex:page>
<!-- your html form goes here -->
</apex:page>
Thanks.
I tried that but gives me many errors.
What errors are you getting? can you post them?
Thanks.
you forgot to put the quotes around type attribute iside the input tag.
It should be like <input type="hidden" blah balh>
Now i am getting another error.
<input type="hidden" name="oid" value="00DT0000000KVU" />
<input type="hidden" name="retURL" value="http://" />
Do the same for your last input tag too, make sure you end your input tag with a, />
Thanks.
Thanks Buddy that helped me a lot.So here is my version of visual force page for sites.
<apex:page>
<form action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type="hidden" name="oid" value="00DT0000000KVU"/>
<input type="hidden" name="retURL" value="http://"/>
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: These fields are optional debugging elements. Please uncomment -->
<!-- these lines if you wish to test in debug mode. -->
<!-- <input type="hidden" name="debug" value=1> -->
<!-- <input type="hidden" name="debugEmail" -->
<!-- value="sai@sftech.com"> -->
<!-- ---------------------------------------------------------------------- -->
<label for="first_name">First Name</label><input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>
<label for="last_name">Last Name</label><input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br/>
<label for="email">Email</label><input id="email" maxlength="80" name="email" size="20" type="text" /><br/>
<label for="company">Company</label><input id="company" maxlength="40" name="company" size="20" type="text" /><br/>
<label for="city">City</label><input id="city" maxlength="40" name="city" size="20" type="text" /><br/>
<label for="state">State/Province</label><input id="state" maxlength="20" name="state" size="20" type="text" /><br/>
<input type="submit" name="submit"/>
</form>
</apex:page>