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
gopikrishnagopikrishna 

how to create field dynamically into web to lead form.

Hi,

    

i have created web to lead with pick list values, if select other option, automatically created one field in that form.

 

Thank you.

AravindBabu512AravindBabu512

Hi,

 

This feature is not available OOB. So, once you select your required fields and Create the Web to Lead form, we need to manually write HTML code to include a field if the picklist field is Other.

 

Thanks,

Aravind

a!a!

Hi,

 

 Describe Field Result Method 

 

i think,this function is useful  for ur query

asish1989asish1989

Hi

  I have a idea in  my mind...

     I will write code for text field in a panel . panel will be hidden defaults.. when other valu is choosen from picklist then outputpanel is rendred.

 

<apex:page controller="Mycontrollernew">
<script type="text/javascript">
function Callmefunc(id)
{
alert(''+id);
var type = document.getElementById(id).value;
alert(type);
alert('hi');

check(type);
return true;


}
</script>
<apex:form>
<apex:pageBlock>
<apex:pageBlockSection>
<apex:inputField value="{!account.Type}" id="check" onchange="Callmefunc('{!$Component.check}');">
<apex:actionFunction name="check" action="{!makingfield}" reRender="refresh">
<apex:param name="Mahavir" value="" />
</apex:actionFunction >
</apex:inputField>
<apex:outputPanel rendered="{!readonly}">

<apex:outputLabel value="Entry" for="tst">
<apex:inputText id="tst"/>
</apex:outputLabel>


</apex:outputPanel>
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

And My controller is 

    

public class Mycontrollernew {
public Account account{get;set;}
public String act{get;set;}
public Boolean readonly {get;set;}
public Mycontrollernew(){
}

public void makingfield() {
act =System.currentPageReference().getParameters().get('Mahavir');
System.debug('!!!!!!!!!!!!!!!!!!!asish!!!!!!!!!!!!!LeadType!!!!!!!!!!!!!!!!!'+act);
if(act=='Other') {
readonly = true;
}
}

}

 

You need to care about Renrded about.

 

Did this post solve your doubt if so please mark it solved.

 

Thanks

asish