On 8 Apr, 11:41, DanWeaver <danofwea...@googlemail.com> wrote:
> I would like the id of each control in the repeated include file to be
> unique
Well you just can't, so find something else to do.
One option is to not use includes, but instead to generate the content
dynamically (trivial bit of PHP loop or something). Then it would be
easy to generate the ids dynamically too.
Alternatively, given that you're already including each include inside
a wrapper that has a unique id, then you could re-write the client-
side
JS or the form handler so as not to require unique ids on each
control. Instead they'd have to infer the "identity" of each control
from the unique id of their parent, in combination with some sub-
selector within this, such as the control type and a class name
attached to it that was unique within that parent (but shared with the
other includes).
Of the two, the first is likely to be easiest.