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
Ricky MartinRicky Martin 

How to update the lead based on hidden value in Web 2 Lead .

Add the lead in first page, when submitted and generates a second page with some hidden inputs containing the stuff the user submitted in the first page.
Then the second page would update that existing lead.
Ashish_SFDCAshish_SFDC
Hi, 


You have to add the Custom fields in the Lead and hide them in the HTML code. 

In the code you can update it by default which will be saved in the Web To Lead. 


Regards,
Ashish
Offshore Freelance ConsultantOffshore Freelance Consultant
Hi,

I assume you want ot get some confirmation from the user for lead creation. 

I see two options. or otherwise, tweak one of these two options to your requirement.

Option 1
------------

You need two html pages.

In your web2lead html page, change form action parameter to refer to second hmtl page, change method to GET from POST.

i.e when we display the web2Lead1.html, and after filling up lead details and click on submit, it gets submitted to web2Lead2.html, which is another html page hosted in the same webserver, same folder.

All the values entered will be passed in querystring to page2. 

In your page 2, read these values using javascript and display them as read only(or as per ur requirement)

In the second html, page, make sure the <form is having
https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST" 

now user submits the second page, lead gets created in sfdc org.

Option 2
-------------
Create two visual force pages and one controller. 

Create a Site, make it accessible for public users without authentication and put the two vf pages on to this Site.

In the first VF page, display <apex:inputtext tags to get the values and on clicking submit,  in the controller, redirect to second vf page

in the second vf page on submission, create the lead.

Hope this helps!
**********************************
J G