jQuery in Action, 3rd edition
The moose likes HTML, CSS and JavaScript and the fly likes Javascript Calendar problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript Calendar problem" Watch "Javascript Calendar problem" New topic

Javascript Calendar problem

Darryl Nortje
Ranch Hand

Joined: Jun 11, 2002
Posts: 140
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...........
I agree. Here's the link: http://aspose.com/file-tools
subject: Javascript Calendar problem
jQuery in Action, 3rd edition