0

its very strange that i am closing the form input field tags but even though i didn’t find it in console.even my form value didn't getting posted. here is my code

<form ng-submit="updatepersonel()" ng-repeat="update in userDetail">
               <div class="form-group">

                <input type="text" class="form-control full" ng-model="perupdate.firstname" ng-value="update.firstname" />
                <label for="exampleInputPassword1">First Name</label>
              <div class="form-group">
                <label for="exampleInputPassword1">Last Name</label>
                <input type="text" class="form-control" ng-model="perupdate.lastname" ng-value="update.lastname" />
              </div>
               <div class="form-group" />
                <label for="exampleInputPassword1">Phone</label>
                <input type="text" class="form-control full" ng-model="perupdate.firstname" ng-value="update.phone" />
              </div>
              <div class="form-group">
                <label for="exampleInputPassword1">Location</label>
                <input type="text" class="form-control full" ng-model="perupdate.location" ng-value="update.location" />
              </div>
             <button  class="btn btn-success" type="submit">Update</button>
            </form>

Edited::

<div class="form-group">
               <form ng-submit="updatepersonel()" ng-repeat="update in userDetail">


                <input type="text" class="form-control full" ng-model="perupdate.firstname" ng-value="update.firstname" />
                <label for="exampleInputPassword1">First Name</label>
              <div class="form-group">
                <label for="exampleInputPassword1">Last Name</label>
                <input type="text" class="form-control" ng-model="perupdate.lastname" ng-value="update.lastname" />
              </div>
               <div class="form-group">
                <label for="exampleInputPassword1">Phone</label>
                <input type="text" class="form-control full" ng-model="perupdate.firstname" ng-value="update.phone" />
              </div>
              <div class="form-group">
                <label for="exampleInputPassword1">Location</label>
                <input type="text" class="form-control full" ng-model="perupdate.location" ng-value="update.location" />
              </div>
             <button  class="btn btn-success" type="submit">Update</button>

            </form>
            </div>
Matthew Rankin
  • 457,139
  • 39
  • 126
  • 163
anujayk
  • 544
  • 7
  • 31
  • That self-closing div may be messing it up `div class="form-group" />`, which then gives you a stray ``. Console shows not only just the HTML as it was rendered, but also the result of the browser trying to fix incorrect HTML. – MikeSmithDev Aug 28 '14 at 15:31
  • Form Still not posting same issue with input tag, see my updated code. – anujayk Aug 28 '14 at 15:37
  • Also i am not getting data in ng-value in input field – anujayk Aug 28 '14 at 15:49
  • Don't do `` ... instead do `` ... it [doesn't need to be closed](http://stackoverflow.com/a/13232170/398606). – Sunil D. Aug 28 '14 at 15:52
  • I tried that too, but even i am not getting data in my text boxes – anujayk Aug 28 '14 at 15:57

1 Answers1

0

i have solved my issue.

what i was doing i was trying to get the data in ng-value. But when i try to bind data in my ng-model i get the solution

js

$scope.perupdate= {
                  firstname: key.firstname,
                  lastname : key.lastname,
                  phone    : key.phone,
                  location : key.location, 
              };

view

 <input type="text" class="form-control full"  ng-model="perupdate.firstname">
anujayk
  • 544
  • 7
  • 31