Hi All,
probably a stupid question, and i imagine it’s as simple as a getelementbyid call, but i’ll ask anyways.
I’m trying to modify the “SpiffyCalendar” for a popup calendar
(source can be seen here if interested [url]http://simplythebest.net/scripts/DHTML_scripts/javascripts/javascript_48.html
What is does basically is you call a function which takes in a few parameters
control name
form name
input name
button name
default date
and it creates a text input box with a button to the right of it to activate the popup calendar.
The problem i’ve come across is that on some of our pages, since they’re displayed dynamically from a DB, that multiple rows may need text input boxes with the same “name” attribute (the called procedure takes these in a varray). So with this calendar it appears to break when there are more than one calendar control with the same “input name”.
I’m thinking that it could be changed to take in an “id” attribute and use that and we could create a unique id for each input box, but i’m just not sure how to do that.
There are lot’s of places in the code that do something similar to this:
[code]
eval(‘document.’+this.formName+’.’+this.textBoxName).className = “cal-TextBox”;
and i believe the
[code]
document.’+this.formName+’.’+this.textBoxName
could be changed to somehow reference by the id instead of the this.textBoxName (which is the input name attribute)…i’m just not exactly sure how to do it.
Any ideas? is this possible?
Thanks