SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    Visible Ninja bronze trophy
    JeffWalden's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,709
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Post Dynarch Calendar Does Not Allow Multiple Instances of Calendar in Single Form

    I'm using the Dynarch DHTML calendar script which can be found at: www.dynarch.com. The problem is that I can only display one calendar at a time. If I place the same code in a second time, the calendar does not "pop-up" when the image is clicked for the second, or third, or fourth calendar.

    My code to generate the calendar button actually uses another JavaScript function, which I have included in this post.

    <tr>
    <td class="fieldLabel">Due Date</td>
    <td class="fieldText"><input type="text" tabindex="90" name="DueDate" id="DueDate" size="10" maxlength="10" Value="">
    <img src="/media/Calendar.gif" id="DueDate" style="cursor: pointer;" title="Select Date" align="absbottom" /><script type="text/javascript"> Calendar.setup( { inputField : "DueDate", ifFormat : "%m/%d/%Y", button : "DueDate" } );</script></td>
    </tr>
    <tr>
    <td class="fieldLabel">Warn Date</td>
    <td class="fieldText"><input type="text" tabindex="110" name="WarnDate" id="WarnDate" size="10" maxlength="10" Value="">
    <img src="/media/Calendar.gif" id="WarnDate" style="cursor: pointer;" title="Select Date" align="absbottom" /><script type="text/javascript"> Calendar.setup( { inputField : "WarnDate", ifFormat : "%m/%d/%Y", button : "WarnDate" } );</script></td>
    </tr>

    Here's the part that really confuses me but I'm sure has to do with the problem. If I use the code as I have it pasted above, only clicking on the first Calendar.gif icon will bring up the calendar. If you click on the second icon nothing will pop-up. However, if I remove the id="WarnDate" from the second text input of the code, the calendar will pop-up correctly. The problem is that without the id property the calendar can't identify and populate the field.

    See attachments to post for the calendar-setup.js function. It's too large to post effectively in here.

    Any ideas why this id property would have anything to do with the functionality of the calendar in terms of popping up? Maybe someone else on here has run into the same problem. I've tried using their forum for support but haven't had any luck.

    Thanks!
    Attached Files Attached Files
    TAKE A WALK OUTSIDE YOUR MIND.

  2. #2
    Visible Ninja bronze trophy
    JeffWalden's Avatar
    Join Date
    Sep 2002
    Location
    Los Angeles
    Posts
    1,709
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Just in-case anyone else ever runs across this same problem, I found that the <img> id property needs to match the button: property but CANNOT match the id property of the <input> field.

    So I just added _Trigger to the end of the id in the <img> and the button:
    TAKE A WALK OUTSIDE YOUR MIND.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •