wood burning stoves 2.0*
The moose likes Struts and the fly likes passing values from struts2 form to javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "passing values from struts2 form to javascript" Watch "passing values from struts2 form to javascript" New topic
Author

passing values from struts2 form to javascript

Vallaru smitha
Ranch Hand

Joined: Aug 19, 2008
Posts: 87

Hi,

we have a textfiled with date and hyperlink edit. The edit hyperlink should be enabled only when the date is between jan 2010 to Dec 2010 or else disabled.

can anyone help me how to check the datereange using <s:if > and also how pass that value to javascript to display an alert msg


Thanks
Vallaru smitha
Ranch Hand

Joined: Aug 19, 2008
Posts: 87

Hi

sorry, from my below post its not textfiled but its field with date .

the date and the hyperlink with edit are displayed on the screen. The edit should be enable only when date ranges between Jan 2010 to Dec 2010. How can that be achieved.


Any help is greatly appreciated.

Thanks
Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

Hi smitha ,

You will have to call a javascript method on Date select that can make the hyperlink disable.

Thanks and regards.
Mohd Raza


Good luck!!
A small leak can sink a Gigantic ship.>
Vallaru smitha
Ranch Hand

Joined: Aug 19, 2008
Posts: 87

Hi,

thanks Raza.

I am not able to pass the date from jsp to javascript . Below is how i am displaying the data



Can you please suggest me how to pass the date to javascript

i also tried using compound statements but they are not working.



But its always going to else loop.

Any suggestions...

thanks












Raza Mohd
Ranch Hand

Joined: Jan 20, 2010
Posts: 247

Hi smitha,

put



in Javasript method as parameter and do logical treatment there..

I Guess it will work.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: passing values from struts2 form to javascript
 
Similar Threads
How to store arraylist in xml file
Printing date
Dynamically assign ID to hyperlink
Hyperlink on the Fly
javascript