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
ManjeetManjeet 

RESET ?

Why Reset functionality is so complex and hard to implement . I am trying since last 3days to reset a inputTextBox and inputField of type PickList ,but I am still not able to do so .

I searched a lot on discussion board and posted my code also . but nobody was to solve that .

 

plzzzzzzzzz help me if anybody can solve it.

thanks a lot in advance

Best Answer chosen by Admin (Salesforce Developers) 
prageethprageeth

Hello Manjeet;

I dont know whether I have understood your problem.

Following is a VF page containing both inputText and picklist components. When you change the fields and click the command button the form will reset. 

 

<apex:page standardController="Opportunity">
  <apex:form>
      <apex:inputtext value="{!Opportunity.name}"/>
      <p/>
      <apex:inputfield value="{!Opportunity.stageName}"/>
      <p/>
      <apex:commandButton value="Reset" onclick="this.form.reset();return false;"/>
  </apex:form>
</apex:page>

If you are expecting a different answer please try to explain further.

 

 

 

 

All Answers

prageethprageeth

Hello Manjeet;

I dont know whether I have understood your problem.

Following is a VF page containing both inputText and picklist components. When you change the fields and click the command button the form will reset. 

 

<apex:page standardController="Opportunity">
  <apex:form>
      <apex:inputtext value="{!Opportunity.name}"/>
      <p/>
      <apex:inputfield value="{!Opportunity.stageName}"/>
      <p/>
      <apex:commandButton value="Reset" onclick="this.form.reset();return false;"/>
  </apex:form>
</apex:page>

If you are expecting a different answer please try to explain further.

 

 

 

 

This was selected as the best answer
ManjeetManjeet

thanks prageeth ,

                             Hey its too easy . I was mislead by myself and was on wrong track . I was tired but does not even think to try this once . thanks again .

thanks a lot .....................

I was trying to reset in controller by reset method .