Angular JS Form validation inside tabset give error : TypeError: Cannot read property '$valid' of undefinedを参照しましたが、探しているものが正確ではありません。
私は
<form name="userForm" ng-submit="submit()" novalidate>
<input type="text" class="form-control" ng-model="user.name" required>
<button type="submit" class="btn btn-primary" ng-disabled="!userForm.$valid">Submit</button>
</form>
そして、私のjs、htmlコードを持っているが、何かのように、
$scope.submitForm = function() {
// check to make sure the form is completely valid
if ($scope.userForm.$valid) {
alert('its working');
}
};
私はこのエラーを取得しています。 ng-submit
を使用していたときにこれを解決する方法はあります。
関数の名前は 'submitForm()'であるのに、なぜ、あなたの 'NG-submit'は、') '(提出しているのでしょうか? – JLRishe
私は、コードの一部を入れています。 –
は私たちに、実際にあなたが持っているものを表すコードを教えてください。内部的に一貫性のないコードではありません。 – JLRishe