• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to call jquery method in Struts.

 
raj jaiswal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I want to auto populate text field by using jquery .Its working when ever i use simple html tag .But when i am using struts tag its not loading page .


Please send the solution.


this jsp page




Thanks
Raj
 
Johannes Geppert
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does the generated html textbox has an attribute id="country".

Johannes
 
raj jaiswal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes the generate textbox having id="country"


if i am this
<input type="text" id="country" name="country"/>

its working fine



thanks
 
Johannes Geppert
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you give a sample of the generated html output when using the struts tags?

Do you have any JavaScript Errors/Warnings in your JavaScript Console?

Johannes
 
Ankit Garg
Sheriff
Posts: 9519
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its not given in the docs of html:text tag that it automatically generates the ID attribute. How did you check that the generated input tag has an ID attribute?? I suggest you try this
This will generate an id="country" attribute for the input tag...
 
raj jaiswal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

Still i not able to find the solution .

Please send help for getting solution

Thanks
Raj
 
Johannes Geppert
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when working with jQuery you should place the code inside a document ready block.



do you get any messages in your javascript console?


Johannes
 
raj jaiswal
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Johannes thanks ,

I have written what ever you sent.
Actually i didnot get any error or warning messege in cosole.Actually its not calling autocomplete("getdata.jsp") method .


So please give me solution,



Thanks
Raj
 
vikas budhvant
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all
I am also facing the same issue please suggest the solution for the mentioned issue
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic