pandit Posted October 5, 2018 Report Posted October 5, 2018 this.appendForm = function (element, id) { element.append('' + '<form-valid ng-show="vm.itemsForm.itemNo' + id + '.$valid"></form-valid>'+ '<form-invalid ng-show="vm.itemsForm.itemNo' + id + '.$touched && vm.itemsForm.itemNo' + id + '.$invalid"></form-invalid>'+ '<div ng-messages="vm.itemsForm.itemNo' + id + '.$error" ng-show="vm.itemsForm.itemNo' + id + '.$touched">'+ '<p class="validation-message" ng-message="required">Please enter item number</p>' ); }; try something like this in your controller. 1 Quote
MegaPowerRockstar Posted October 5, 2018 Author Report Posted October 5, 2018 1 hour ago, pandit said: this.appendForm = function (element, id) { element.append('' + '<form-valid ng-show="vm.itemsForm.itemNo' + id + '.$valid"></form-valid>'+ '<form-invalid ng-show="vm.itemsForm.itemNo' + id + '.$touched && vm.itemsForm.itemNo' + id + '.$invalid"></form-invalid>'+ '<div ng-messages="vm.itemsForm.itemNo' + id + '.$error" ng-show="vm.itemsForm.itemNo' + id + '.$touched">'+ '<p class="validation-message" ng-message="required">Please enter item number</p>' ); }; try something like this in your controller. how to call this from html control. can you use my sample form that i posted Quote
KATHRI Posted October 5, 2018 Report Posted October 5, 2018 check this plunker https://next.plnkr.co/edit/vuQiH4D8qUY9jVoThnCy?p=preview&preview Quote
MegaPowerRockstar Posted October 5, 2018 Author Report Posted October 5, 2018 18 minutes ago, KATHRI said: check this plunker https://next.plnkr.co/edit/vuQiH4D8qUY9jVoThnCy?p=preview&preview Super.. got it working.. thanks for your effort in putting this out.. Quote
MegaPowerRockstar Posted October 5, 2018 Author Report Posted October 5, 2018 1 hour ago, KATHRI said: check this plunker https://next.plnkr.co/edit/vuQiH4D8qUY9jVoThnCy?p=preview&preview can you give me some idea how to apply for selectize control also..i tried below code but no luck <div> <selectize config='vm.itemSelectValues' options='vm.item' ng-model="vm.newitem.otheritem[i.id].item" name="selected_item{{i.id}}" id="selected_item{{i.id}}" require="true"></selectize> <div ng-messages="vm.otheritemForm['selected_item' + i.id].$error" ng-show="vm.otheritemForm['selected_item' + i.id].$touched"> <p class="validation-message" ng-message="required">Please select your item.</p> </div> </div> Quote
KATHRI Posted October 5, 2018 Report Posted October 5, 2018 Check this http://embed.plnkr.co/2lN4NRFN8VF6kUZqPs0M Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.