Thanks for your response @sid. Iâm probably not making much sense as per usual so apologies for that.
So what you say is what I thought. Maybe iâm over complicating what I am trying to achieve.
So what I have is the user will enter how many blocks there are ( a maximum of 10 blocks can be specified ). So for example:
if they enter the number 3, then 3 âblock name / block numberingâ pairs ( form groups ) will be shown by using âShowâ attributes. so for example:
<div class="form-group row" dmx-show="(blocks.value >= 3)">
<label for="blockName3" id="block3-label" class="sr-only">Block 3 name</label>
<div class="col-lg-6 col-xl-7">
<input type="text" class="form-control" id="blockName3" name="block_name_3" aria-describedby="block3-label" placeholder="Name of block 3" required="" data-msg-required="Please specify the name of this block." dmx-bind:required="(blocks.value > 2)">
</div>
<label for="blockNumbering3" id="numbering3-label" class="sr-only">Block 3 numbering</label>
<div class="col-lg-6 col-xl-5">
<input type="text" class="form-control" id="blockNumbering3" name="block_numbering_3" aria-describedby="numbering3-label" placeholder="Numbering 3" required="" data-msg-required="Please specify the numbering for this block." dmx-bind:required="blockName3.value">
</div>
</div>
This works for number 2 -10 because.
block name / numbering 1and 2 donât use show attributes because this section is for multi-blocks and there will always be at least 2 blocks.
block name / numbering 3 -10 each use the >= operator so the right amount of block name / numbering pairs are shown.
So at this point is where it goes wrong.
I need to validate for the numbers 11 and more as the form can except up to 10 blocks.
So I thought I would put a CR around the 10 block name / numbering pairs with a condition using the value entered above that is true for a value less than 11. So when numbers 2 - 10 is entered then the CR is shown and the correct amount of âblock name / numbering pairsâ will shown. If 11 or more is entered then CR is false and it is hidden. ( I have a message alert in a CR that is true for 11 or more saying - maximum of 10 blocks allowed )
But what is happening is letâs say the number 3 is entered so the CR is true and shows the region but only 3 block name / numbering pairs are shown. BUT⌠the validation for the âblock name / numberingâ pairs do not work. The CR seems to effect the validation.
Apologies if this is confusing and I hope it makes some kind of sense.