• VRay
  • 0 Points
  • Member since 2010

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 4

How do we integrate jQuery with VisualForce pages?

Thanks in Advance

freshstart force

The Date Picker shows only few Years from (2009 to 2015) or something. I would like to accept the Date of Birth as input and I would like to list all years in the Date picker Year dropdown. Is there any way I can do it declaratively? If its not possible in the declarative manner, is there any solution that does not require me to write the whole apex sheebang for that particular page? Even if writing a complete apex, page is the only solution, please confirm it.

Thanks in Advance

freshstart force

I know that we can call the click() event of a button from Javascript like below ...but I can't access the click event of an inputText element.


Thanks for the help!!!!


var btnCopy = document.getElementById("{!$Component.btnCopy}");



<apex:inputText onClick="a();" /> 
<apex:inputText id="zz" onClick="alert('hi');"/> 
       function a() {


I am trying to build a Search Page using SOSL query (just followed the example in VF guide book).


But the query doesn't reurn any row. Here is the Controller Code



public class woController {
String searchText;
List<Work_Order__c> workOrders = new List<Work_Order__c>();
public String getSearchText() {
return searchText;
public void setSearchText(String s) {
searchText = s;
public List<Work_Order__c> getWorkOrders() {
return workOrders;
public PageReference doSearch() {
workOrders = (List<Work_Order__c>)[FIND :searchText IN ALL FIELDS RETURNING
    Work_Order__c(Id, Name, Account__c, Service_Order__c, CreatedById, Work_Order_Status__c, CreatedDate)][0];
return null;



Here is the VF page code -


<apex:page controller="woController" tabStyle="Work_Order__c">
<apex:form >
<apex:pageBlock mode="edit" id="block">
<apex:pageBlockSection >
<apex:pageBlockSectionItem >
<apex:outputLabel for="searchText">Search Text</apex:outputLabel>
<apex:panelGroup >
<apex:inputText id="searchText" value="{!searchText}"/>
<apex:commandButton value="Go!" action="{!doSearch}" rerender="block" status="status"/>
<apex:actionStatus id="status" startText="requesting..."/>
<apex:pageBlockSection title="Results" id="results" columns="1">
<apex:pageBlockTable value="{!workOrders}" var="wo" rendered="true">
<apex:column value="{!wo.Name}"/>



If I use SOQL query for any particular field search, then it works. Any help would be appreciated.