This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Five Lines of Code and have Christian Clausen on-line!
See this thread for details.
Win a copy of Five Lines of Code this week in the OO, Patterns, UML and Refactoring 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 ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Javascript Calendar problem

Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I was given a javascript calendar that is able to insert the user selected date into a field on a jsp page. The problem that I have is that that is in a static environment. ie: the parameter name is coded in the javascript calendar .js file. What I need to do is this. According to records on a database I am build up a page that looks similar to this -->
Attibute Value
First Name [_________] <-- text box
Surname [_________]
Now when the attribute is a Date, I want to make the Value textbox readonly, and to put a link next the the value text box, that opens up a javascript calendar and the user selected date must be inserted in the correct text box. The problem that I am having is that I can't find anyway of of passing the name of the field in to the js calendar, and it then succesfully using it to set the date. Does anyone have any ideas how I can get around this problem.
Also to mention again, that page is dynamic, It grows depending on records in a database. Here is the jsp code snippet that builds the table. I am using struts...........
<logic:iterate name="attrib" id="collElem">
<td width="472">
<bean:write name="collElem" property="value"/></td>
<td width="398">
<input name="<bean:write name="collElem" property="key"/>" <bean:write name="collElem" property="read"/>/>
<logic:equal name="collElem" property="read" value="readonly">
<a href="javascript:show_calendar('<bean:write name="collElem" property="key"/>');">...'<bean:write name="collElem" property="key"/>.value'</a>
Any ideas please...........
Enjoy the full beauty of the english language. Embedded in this tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic