Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1410
  • Last Modified:

struts2 tooltip

im trying to display the struts2 tooltip icon in my jsp page. i have added the javascriptTooltip in form and tooltip in the textfield. Im not sure what im doing wrong here.

the code is as below.

<s:form id="user" theme="simple" action="modifyUserAction" cssClass="myform"  javascriptTooltip="true">

<li><label><span class="red">*</span> First Name:</label> <s:textfield id="firstName" name="firstName" maxlength="32" cssClass="text" theme="simple" tooltip="Enter firstname"/></li>

</s:form>

<script>
$(document).ready(function() {
      $('#firstName').tooltip();
});
</script>
0
Newton21205
Asked:
Newton21205
  • 2
  • 2
1 Solution
 
chaitu chaituCommented:
the attribute should be title not tooltip..

<s:textfield id="firstName" name="firstName" maxlength="32" cssClass="text" theme="simple" title="Enter firstname"/></li>
0
 
chaitu chaituCommented:
i assume you have included these two js in your jsp.

    <script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
  <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
0
 
Newton21205Author Commented:
yes  i have the two queries. Also title did not work.
0
 
Newton21205Author Commented:
thank you i was able to show the tooltip using title. This is what i did.
Now im trying to post this key to action class to retrieve value from the database.

Please can you show me how to use onclick event with jquery to send this through ajax.

<li><label><span class="red">*</span> Firstname: <i class="icon-info-sign" title="<s:property value="%{description}"/>" id="firstName"></i></label> <s:textfield id="firstName" name="firstName" maxlength="32" cssClass="text" theme="simple"/></li>
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now