+ Start a Discussion
sid_ssid_s 

creating buttons in visual force

Hi, I want to create a custom button in visualforce and On clicking that button i should be redirected to a form.

Could someone help me out for this scenario

Samba GSamba G

You means popup a form when this button is clicked.

 

 

Thanks,

Samba

nikkeynikkey

Hi Sid ,

Just try this example and check which is related to your criteria.

Visual Page code :  

<apex:page controller="SFLoginPage" sidebar="false">
<apex:form >

USERNAME <apex:inputText value="{!USERNAME}"/>

<br></br><br></br>

PASSWORD <apex:inputSecret value="{!PASSWORD}"/>

<br><apex:commandButton value="Login" action="{!SAVE}"/></br>

 </apex:form>

</apex:page>

Apex Code :

public with sharing class SFLoginPage
{
public String USERNAME { get; set; }

public String getUSERNAME()
{
return null;
}

public String PASSWORD { get; set; }

public String getPASSWORD()
{
return null;
}
public String option {get;set;}
public PageReference Save()
{
PageReference pg = new PageReference('/apex/SFPage2?val=' + option);// mention the page name which should get open.
pg.setRedirect(true);
return pg;

}