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
nani@rnani@r 

can u tell me a controller class ?

can u tell me a controller class for this code ?

 

 

 

 

<apex:page id="page1"

<apex:form id="form1">

<apex:pageBlock id="block1">

<apex:pageBlockSection id="section1">

<apex:outputText >User Name</apex:outputText>

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

<apex:outputText >User Password</apex:outputText>

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


<apex:commandButton id="save1" value="Save" action="{!save}" onclick="CheckSave()" />

</apex:pageBlockSection>

</apex:pageBlock>
</apex:form>


</apex:page>

Navatar_DbSupNavatar_DbSup

Hi,

Try the below code snippet as reference:

................

Page

...............

<apex:page id="page1" controller="Login_Info">

<apex:form id="form1">

<apex:pageBlock id="block1">

<apex:pageBlockSection id="section1">

<apex:outputText >User Name</apex:outputText>

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

<apex:outputText >User Password</apex:outputText>

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

 

<apex:commandButton id="save1" value="Save" action="{!save}" onclick="CheckSave()" />

</apex:pageBlockSection>

</apex:pageBlock>

</apex:form>

 

</apex:page>

 

 

..............

Controller

..............

 

public class Login_Info

{

 public String password { get; set;}

 public String name { get; set; }

 

public Void save()

{

 Login_Info__c obj=new Login_Info__c();

obj.Name=name;

obj.Login_User_Password__c=password;

insert obj;

}

}

 

Here "Login_Info__c" is a custom object and i created a two fields "Name" and "Login_User_Password__c" in this objects.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.