function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BrandiTBrandiT 

Convert HTML Web-to-Lead Form into Apex code for Sites?

I'm trying to use sites to post a web-to-lead form for tradeshows.  I'm using the HTML generated by Salesforce, with some additional coding to make it look nice.  I tried posting on Sites, but the editor keeps giving me error messages.  I corrected most of them, but the editor does not like my <input> html tags. 

 

Is there no way to use html web coding in Sites?  I have not worked at all with Apex/Visualforce.

 

Thanks!

BulentBulent
yes. Use the clipboard icon with the letter C on it.
RyanGuestRyanGuest
What error are you getting when you try to save?
dmsx2oddmsx2od

Saying you've never used Apex/VF but want to code a Sites page is like saying that you've never been in a simulator but want to fly the plane.

 

Go through the tutorials, learn Visualforce, and then code the page.   It's not that difficult, but it does require some learning.

slaneslane
Ideally, if you're going to use Sites, you would try to improve on the web-to-lead technology. Sites/VF would allow you to hook directly into things like validation, and generally tie the page more tightly to the back end. If you're going to stick with the old W2L techniques, there doesn't seem to be an obvious need to embed that in a VF page. It should continue to work fine as is.
TbomTbom

Also very good to know your Database DMLOptions Methods.  If you want to use Site/VF to mimic a W2L and there's a need to preserve Assignment Rules and Auto-Response Rules, you'll need to say so in your Controller by invoking DMLOptions methods like so:

 

Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule = true;
dmo.EmailHeader.triggerAutoResponseEmail = true;

lead.setOptions(dmo);

Message Edited by Tbom on 12-03-2009 11:18 PM
sf.dev.ax1103sf.dev.ax1103

HI ,

 

        Have u converted web to lead form to visual force.Can you please share your code.

 

Thanks