Win a copy of TensorFlow 2.0 in Action this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

passing values from struts2 form to javascript

 
Ranch Hand
Posts: 87
Hibernate Firefox Browser 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
Hibernate Firefox Browser 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
 
Ranch Hand
Posts: 247
MyEclipse IDE MySQL Database Java
  • 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
Hibernate Firefox Browser 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
MyEclipse IDE MySQL Database Java
  • 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.
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic