1
我对angularjs非常陌生,并用角度模式选择框替换了常规html <select>
框。使用angularjs选择框提交表单
选择框填充$ http ajax请求并加载数据正常,但表单无法提交。
我的原代码:
<body>
<form id="form-filename">
<div align="center"><select name="filename" id="filename" class="browser-default"></select></div>
<input type="button" id="submit-filename" value="Apply"><br>
</form></body>
我的版本与角度选择框:
<body ng-app="httptest" ng-controller="getjson">
<form id="form-filename">
<button class="semi-transparent-button" name="filename" modal-select="" ng-model="someModel" options="data" modal-title="Select Location"> Select File
<div class="option">
{{option}}
</div></form>
我不知道我需要修改,以获得选择框提交表单和更新文件名值。
什么是 “不及格”在你的意思案件? – lin
请参阅[AngularJS开发人员指南 - 表单](https://docs.angularjs.org/guide/forms)并使用[ng-submit指令](https://docs.angularjs.org/api/ng/directive/ ngSubmit)。 – georgeawg