Bootstrap Datetimepicker with dynamic mirror fields <p>I'm using <a href="http://www.malot.fr/bootstrap-datetimepicker/" rel="nofollow noreferrer">http://www.malot.fr/bootstrap-datetimepicker/</a> and I have this snippet:</p> <pre><code>&lt;div class="input-group date form_datetime"&gt; &lt;input type="text" class="form-control" name="startDateTime" id="startDateTime"&gt; &lt;input type="hidden" id="startDateTime_mirror" name="startDateTime_mirror"&gt; &lt;span class="input-group-btn"&gt; &lt;button class="btn btn-default date-set" type="button"&gt; &lt;i class="fa fa-calendar"&gt;&lt;/i&gt; &lt;/button&gt; &lt;/span&gt; &lt;/div&gt; </code></pre> <p>Please notice that the <code>input[type=text]</code> and the <code>input[type=hidden]</code> fields have the same <code>id</code>, but the latter with a <code>_mirror</code> suffix </p> <p>Since I have a couple of datepickers in a page (i.e. also <code>endDateTime</code> and <code>endDateTime_mirror</code>), I can't use a 'fixed' mirror field id as in datetimepicker's demo page</p> <p>EDIT: an example of two datetimepickers</p> <pre><code>&lt;div class="input-group date form_datetime"&gt; &lt;input type="text" class="form-control" name="startDateTime" id="startDateTime"&gt; &lt;input type="hidden" id="startDateTime_mirror" name="startDateTime_mirror"&gt; &lt;span class="input-group-btn"&gt; &lt;button class="btn btn-default date-set" type="button"&gt; &lt;i class="fa fa-calendar"&gt;&lt;/i&gt; &lt;/button&gt; &lt;/span&gt; &lt;/div&gt; &lt;div class="input-group date form_datetime"&gt; &lt;input type="text" class="form-control" name="endDateTime" id="endDateTime"&gt; &lt;input type="hidden" id="endDateTime_mirror" name="endDateTime_mirror"&gt; &lt;span class="input-group-btn"&gt; &lt;button class="btn btn-default date-set" type="button"&gt; &lt;i class="fa fa-calendar"&gt;&lt;/i&gt; &lt;/button&gt; &lt;/span&gt; &lt;/div&gt; </code></pre> <p>I tried this, but it doesn't work (even if the 'generated' name is right, <code>startDateTime_mirror</code> (I can see it in <code>console.log()</code>):</p> <pre><code>$(".form_datetime").datetimepicker({ autoclose: true, format: "dd MM yyyy hh:ii", linkField: ($(this).find('.form-control').prop('id')) + '_mirror', linkFormat: "yyyy-mm-dd hh:ii" }) </code></pre> <p>Any help, please? Thanks</p>