Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6368919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:44:11+00:00 2026-05-25T00:44:11+00:00

I just went thru w3schools tutorial for JQuery. I am trying ot write a

  • 0

I just went thru w3schools tutorial for JQuery. I am trying ot write a function in seam/richfaces app. I have a search icon and onclick of the search icon, I want to toggle certain fields in UI. But nothing happens and i dont see any errors in firebug. Please help.

<rich:dataTable id="acctListTbl" value="#{accounts}" var="account" width="100%">
    <rich:column>
   <f:facet name="header">
    <h:panelGroup>
         <h:graphicImage id="srchIcon" value="/images/search_icon.png" 
                             styleClass="search-icon"/> 
            <h:outputText value="Action" />
        </h:panelGroup>
   </f:facet>

 <script type="text/javascript">
    jQuery(document).ready(function(){
  jQuery("#acctListTbl:srchIcon").click(function(){
      jQuery('.search-field').toggle(); 
  });
 });
 </script>

Here is the html. As user914670 pointed out, there is no jquery handler added to my search icon rendering. So what is wrong?

 <div id="j_id12:acctListTbl:j_id31header:sortDiv">
    <img id="j_id12:acctListTbl:srchIcon" class="search-icon"  
         src="/xxxx/images/search_icon.png">
         Action
 </div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:44:11+00:00Added an answer on May 25, 2026 at 12:44 am
    jQuery(document).ready(function(){   
          jQuery(".search-icon").click(function(){       
                  jQuery('.search-field').toggle();    
           });  
    }); 
    

    or if you love ids you could do

    jQuery(document).ready(function(){   
          jQuery("[id$=srchIcon]").click(function(){       
                  jQuery('.search-field').toggle();    
           });  
    }); 
    

    $= means that ends with

    ^= means starts with

    *= means contains

    Also I would check out SelectorGadget for use in Firefox. Its really good for finding the selector statement you need to get a certain element.

    One last thing that I do to make sure that I am in side an event is put an alert statement that goes off in side the function to let me know that my select statement is correct.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just went through a bunch of stuff trying to figure out how to
I've just completed the very very nice django tutorial and it all went swimmingly.
I just went through the whole certificate/keychain/provisioning/appID/profile/DNA test process to get my app running
I just went to submit my first app involving iAds, and in the beginning
I just went through this tutorial: update-widget-in-onreceive-method (btw: would you propose any improvements to
I just went through a spring transaction tutorial which mentions that there are some
So just went through this tutorial: http://icodeblog.com/2010/04/05/ipad-programming-tutorial-hello-world/ Now what I want to do is
I just went to write the line... if (!e.PeriodicData.Keys.Contains(process)) { } but did a
I've just started learning javascript and have created a drag and drop using jquery
I just went to android market to publish an update to my app and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.