aspose file tools*
The moose likes Struts and the fly likes How to call jquery method in Struts. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How to call jquery method in Struts." Watch "How to call jquery method in Struts." New topic
Author

How to call jquery method in Struts.

raj jaiswal
Ranch Hand

Joined: Nov 25, 2008
Posts: 56
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

Joined: Jan 12, 2010
Posts: 67
does the generated html textbox has an attribute id="country".

Johannes


My Java and Webprogramming Blog
raj jaiswal
Ranch Hand

Joined: Nov 25, 2008
Posts: 56
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

Joined: Jan 12, 2010
Posts: 67
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

Joined: Aug 03, 2008
Posts: 9313
    
  17

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...


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
raj jaiswal
Ranch Hand

Joined: Nov 25, 2008
Posts: 56
hi

Still i not able to find the solution .

Please send help for getting solution

Thanks
Raj
Johannes Geppert
Ranch Hand

Joined: Jan 12, 2010
Posts: 67
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

Joined: Nov 25, 2008
Posts: 56
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

Joined: Mar 20, 2013
Posts: 1
Hi all
I am also facing the same issue please suggest the solution for the mentioned issue
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to call jquery method in Struts.