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
sandeep kumar 1996sandeep kumar 1996 

Need jquery validations for search and clear buttons of my vf page

vf page:
<apex:page standardController="account" extensions="accsearchcontroller" sidebar="false">
  <apex:form id="formID"> 
  <apex:actionFunction name="searchtext" action="{!search}"/>
 <apex:pageBlock >
<apex:pageBlocksection title="Accounts" columns="1">
 
 
<apex:inputText value="{!searchstring}" label="Account number" id="sh" html-placeholder="Please enter account number"  />
<p class="search">please enter account number</p>
 </apex:pageBlocksection>
 <apex:commandButton value="Search"  action="{!search}"/>
 <apex:commandButton value="Clear" id="clear" action="{!clear}"/> <!--  action="{!clear}" -->
</apex:pageBlock> 
<apex:pageBlock id="resultPanel">
<apex:pageblockTable value="{!acc}" var="a" id="TT"> 
     <apex:column >
 <apex:facet name="header"> Employee Name   </apex:facet>
     <apex:outputLink value="/{!a.id}" id="hh" target="_Blank"> {!a.name} </apex:outputLink>
     </apex:column>
     <apex:column >
       <apex:facet name="header"> Employee Number</apex:facet>
       {!a.AccountNumber}
       </apex:column>   
</apex:pageBlockTable>
    </apex:pageBlock>
 </apex:form>
</apex:page>

controller:

public with sharing class accsearchcontroller {  
   public list <account> acc {get;set;}  
   public string searchstring {get;set;}  
   public accsearchcontroller(ApexPages.StandardController controller) {  
   }  
   public void search(){  
     string searchquery='select AccountNumber,name,id,Type from account where AccountNumber like \'%'+searchstring+'%\'';
     acc= Database.query(searchquery);  
   }  
   public void clear()
   {
      acc.clear();
      }
  
}                             
Naval Sharma4Naval Sharma4
You did not mention about the validation you need here. 
If you want to apply required field validation then see the following link.
https://sfcure.wordpress.com/2017/01/28/vfvalidator-form-validation-in-visualforce-page/