To use AngularJS validation status I need to reference the form by its name. However the form that I have does not have a name, and I have no idea how to set a name, other than using Javascript, which I don't want to do. When I add the name
attribute to the <form runat="server">
it doesn't appear in the output HTML.
Example of how it would be ideal to work:
<form name="form">
<div ng-app="myApp" ng-controller="myCtl">
First Name: <input type="text" name="firstName" ng-model="firstName" required><br>
<span ng-show="form.firstName.$dirty">Dirty</span>
</div>
</form>
A solution would be either of these two:
- Reference the form elements by ID instead of name
- Get ASP.NET webforms to output the
name
attribute