Reputation: 147
How do I make sure .NET does not remove the NAME attribute from my HTML forms. I require this in order to use AngularJS. Please let me know.
in visualstudio my form looks like this:
<form id="scheduleFrm" name="scheduleFrm" runat="server">
but it ends up looking like this in my browser's source:
<form id="scheduleFrm" method="POST"> without the name attribute
AngularJS needs the name attribute but name is available for my form
Upvotes: 4
Views: 1352
Reputation: 2517
This is bad but it will get you going again:
<form id="theName" ...>
<script>document.getElementById("theName").setAttribute("name", "theName");</script>
<!-- ...formalities -->
</form>
Upvotes: 2
Reputation: 947
There is an workaround. If you do for example:
$scope.scheduleFrm...
to access your form, so you can do:
var formName = $("#scheduleFrm").attr("name");
$scope[formName]...
to do the same.
Upvotes: 0