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 7895821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T07:44:09+00:00 2026-06-03T07:44:09+00:00

I’m new to Struts2, but I’m consistently running into issues with jQuery selectors not

  • 0

I’m new to Struts2, but I’m consistently running into issues with jQuery selectors not being able to access any of the Struts2 tags we have defined in our jsps.

I’m assuming that they don’t integrate without a lot of custom code or a plugin, but I haven’t been able to find anything definitive in writing about it. When I went to the strut2-jQuery plugin page they mention it’s better to use a plugin in their faq, but not something that is required.

Am I missing something here? If I have a struts2 tag for an element and try to select it using jQuery, it doesn’t seeem to work. I’m talking basic elements like

$('form').find(':input').change(function() { ...  //or

$('#testbutton').attr('disabled', true);  //or

 $('#formName').change(function() { 
          alert("Found form!"); 
     });

So when I look at view source, I see regular html code that gets generated from the tags, I just can’t reach those specific elements using selectors if it was from a struts2 tag versus a regular html tag with the same jQuery selector code.

One other item, I’m using something like this to reference jQuery on the jsp page:

<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js" type="text/javascript"></script>
  • 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-06-03T07:44:10+00:00Added an answer on June 3, 2026 at 7:44 am

    How the HTML is generated is not relevant to the client (the browser), and the client is ignorant of anything beyond the generated DOM.

    If there’s an ID, or it’s an input, jQuery will find it–I’ve used plain jQuery (and Prototype) with S2 apps for years without issue.

    Something else is wrong.


    Edited to show JSP, rendered HTML, and console output.

    JSP:

    <s:form action="simpleForm">
      <s:textfield name="fname"/>
      <s:submit value="Go!"/>
    </s:form>
    

    Rendered HTML (assuming default "xhtml" theme):

    <form id="simpleForm" name="simpleForm" action="/simpleForm.action" method="post">
      <table class="wwFormTable">
        <tr>
          <td class="tdLabel"></td>
          <td><input type="text" name="fname" value="" id="simpleForm_fname"/></td>
        </tr>
    
        <tr>
          <td colspan="2"><div align="right"><input type="submit" id="simpleForm_0" value="Go!"/>
          </div></td>
        </tr>
      </table></form>
    

    Some console output:

    > $("form")
    [<form id=​"simpleForm" name=​"simpleForm" action=​"/​simpleForm.action" method=​"post">​…​</form>​]
    > $("form").find(":input")
    [<input type=​"text" name=​"fname" value=​"d" id=​"simpleForm_fname">​, 
     <input type=​"submit" id=​"simpleForm_0" value=​"Go!">​]
    > $("form").find("input") // Don't need the ":"
    [<input type=​"text" name=​"fname" value=​"d" id=​"simpleForm_fname">​,
     <input type=​"submit" id=​"simpleForm_0" value=​"Go!">​]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am currently running into a problem where an element is coming back from
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I have a jquery bug and I've been looking for hours now, I can't
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported

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.