Development

#641 ([PATCH] Generated ids for form fields and these used by calendar don't match)

You must first sign up to be able to contribute.

Ticket #641 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

[PATCH] Generated ids for form fields and these used by calendar don't match

Reported by: anonymous Assigned to:
Priority: major Milestone: 0.6.3
Component: Version: 0.7.X
Keywords: Cc:
Qualification:

Description

Today I noticed (after getting symfony from svn), that id attribute for fields in generated admin don't match these given to calendar's configuration, e.g. I have a field addtime, and it's generated to:

  <input type="text" name="news[addtime]" id="news_addtime" value="" withtime="1" calendar_button_img="/sf/images/sf_admin/date.png" size="9" /><img id="trigger_news[addtime]" style="cursor: pointer; vertical-align: middle" src="/web/sf/images/sf_admin/date.png" alt="Date" /><script type="text/javascript">
    document.getElementById("trigger_news[addtime]").disabled = false;
    Calendar.setup({
      inputField : "news[addtime]",
      ifFormat : "%Y-%m-%d",
      button : "trigger_news[addtime]"
    });
  </script>

As for now calendar uses getElementbyId, so it's completely broken in this case.

Attachments

diff.patch (494 bytes) - added by francois on 06/20/06 17:39:09.
[PATCH] This seems to do the trick

Change History

06/20/06 17:39:09 changed by francois

  • attachment diff.patch added.

[PATCH] This seems to do the trick

06/20/06 17:42:02 changed by slickrick

  • summary changed from Generated ids for form fields and these used by calendar don't match to [PATCH] Generated ids for form fields and these used by calendar don't match.

That patch will work, just make sure to use get_id_from_name(), as the function has been updated in a recent SVN.

06/21/06 11:02:47 changed by fabien

  • status changed from new to closed.
  • resolution set to fixed.
  • milestone set to 0.6.3.

in r1491