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
teja swi 10teja swi 10 

Edit is not working on web to lead vf page please help me with this

====>>>>> My vfpage <<<<======


<apex:page controller="aaaa"> <script> function fun121(id,inputid) { document.getElementById(inputid).value = id; alert('hi'+id); return true; } </script> <apex:form > <apex:pageBlock > <apex:pageBlockSection title="New Lead"> <!-- ---------------------------------------------------------------------- --> <!-- 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 action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST"> <input type="hidden" name="oid" value="00D28000000dlOU"/> <input type="hidden" name="retURL" value="http://www.google.com"/> <!-- ---------------------------------------------------------------------- --> <!-- 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="teja.gujjula@gmail.com"> --> <!-- ---------------------------------------------------------------------- --> <label for="first_name">First Name :</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br/> <label for="last_name">Last Name :</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br/> <label for="email">Email :</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="email" maxlength="80" name="email" size="20" type="text" /><br/> <label for="company">Company :</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="company" maxlength="40" name="company" size="20" type="text" /><br/> <label for="city">City :</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="city" maxlength="40" name="city" size="20" type="text" /><br/> <label for="state">State/Province</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="state" maxlength="20" name="state" size="20" type="text" /><br/> <input type="submit" name="submit"/> </form> </meta> </apex:pageBlockSection> <apex:pageBlockSection title="Lead Records" columns="1"> <apex:pageblockTable value="{!ldlist}" var="a"> <apex:column headerValue="First Name" value="{!a.FirstName}"/> <apex:column headerValue="Last Name" value="{!a.LastName}"/> <apex:column headerValue="E-mail" value="{!a.Email}"/> <apex:column headerValue="Company" value="{!a.Company}"/> <apex:column headerValue="City" value="{!a.city}"/> <apex:column headerValue="State" value="{!a.state }"/> <apex:column > <apex:commandLink value="Edit" action="{!leadedit}" onclick="fun121('{!a.id}','oid')" style="font-family:verdana" immediate="true"/> </apex:column> </apex:pageBLockTable> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page>






======>>>>> Controller  <<<<<======

public with sharing class aaaa
{
  public Lead ld{get;set;}
  public List<Lead> ldlist{get;set;}
  
   
  public aaaa()
  { 
      ldlist=[select FirstName,LastName,Email,Company,city,state from Lead];
   
   }
   
     public void leadedit()
           {    
             
              String ownid=System.currentPageReference().getParameters().get('oid');
              System.debug('ownerrrr'+ownid);
              ld = [select FirstName,LastName,Email,Company,city,state from Lead  where id =:ownid limit 1];
           }
 }