1
votes

I am using Django formset to enter values ​​in multiple forms on one page. The 'date' field uses the 'datetimepicker' jquery, but the datetimepicker is not applied separately to each 'date' field of the 3 forms. In my opinion, each input has a unique name, so I need to create a regular expression using it. What do I need to fix?

$( ".date" ).datetimepicker({
    format: 'Y-m-d H:i'
});

<input type="text" name="form-0-date" id="date" autocomplete="off" class="form-control col-sm-12 date">
<input type="text" name="form-1-date" id="id_form-1-date" autocomplete="off" class="form-control col-sm-12 date">
It's not at all clear how regular expressions are related to anything you've posted here at all, aside from the fact that you seem insistent on using them somehow. "What do I need to fix?" What's wrong with the code you've posted, for starters? Can you demonstrate it using a minimal reproducible example? See How to Ask – esqew