Hello,
I have multiple textboxes which is created dynamically when user click on a button called "Add new section". my section code looks like this
PHP Code:
<div id="secAsset">
<div class="mb-3 col-md-6">
<label for="assetType" class="form-label">Asset Type</label>
<input class="form-control" type="text" id="assetType" name="assetType[]"
placeholder="Mobile Phone" value="" autofocus />
</div>
<div class="mb-3 col-md-6">
<label for="assetRemark" class="form-label">Remarks</label>
<input class="form-control" type="text" id="assetRemark" name="assetRemark[]"
placeholder="Enter any remarks including ref no," value="" autofocus />
</div>
</div>
I have model called AssetsModel.php and there i have added rule required to both fields (type and remarks). But when the validation fails how i can display the error message for each field ?
can you give me an idea ?