• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing values from struts2 form to javascript

 
Vallaru smitha
Ranch Hand
Posts: 87
Firefox Browser Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 87
Firefox Browser Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi smitha ,

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

Thanks and regards.
Mohd Raza
 
Vallaru smitha
Ranch Hand
Posts: 87
Firefox Browser Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 247
Java MyEclipse IDE MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi smitha,

put



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

I Guess it will work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic