2014-04-10 2 views
0

양식이 있습니다. 서식 요소 외부에 저장 버튼이 있어야하지만 양식을 새로 고치는 경우 양식을 새로 고치는 것이 좋습니다.버튼을 꺼내면 새로 고치지 않는 값을 제출하는 양식

<form ng-submit="save()" action="" name="addInv" novalidate> 
      <div class="col-md-10"> 
       <label>Name:</label> 
       <input type="text" ng-model="newlocation.name" class="form-control"> 
      </div> 
      <div class="col-md-10"> 
       <label>Storage administrator:</label> 
        <select ng-model="newlocation.administrator" class="form-control" ng-options="user.resource_uri as user.first_name for user in users"></select> 
      </div> 
      <div class="col-md-6"> 
       <label>Street:</label> 
       <input type="text" ng-model="newlocation.street" class="input-medium form-control"> 
      </div> 
      <div class="col-md-6"> 
       <label>City:</label> 
       <input type="text" ng-model="newlocation.city" class="input-medium form-control"> 
      </div> 
      <div class="col-md-6"> 
       <label>Country:</label> 
       <input type="text" ng-model="newlocation.country" class="input-medium form-control"> 
      </div> 
      <div class="col-md-6"> 
       <label>Postal code:</label> 
       <input type="text" ng-model="newlocation.postalCode" class="input-medium form-control"> 
      </div> 
      <div class="col-md-6"> 
       <button class="btn tbn-lg btn-primary">Save</button> 
      </div> 
</form> 

버튼을 넣으면 <form> 양식을 새로 고치지 않습니다.

답변

1

<input type="submit" onclick="document.forms[0].submit();" /> 
을 자바 스크립트를 사용할 수
관련 문제