我正嘗試在我寫的簡單窗體上使用AngularJS。 採用NG-選擇我,但是當表單驗證,我從選擇獲得的價值是我的首選陣列中的範圍,而不是實際的字符串我在形式發送數組值的角度ng選項
<section id="signin" ng-controller="Sign_in">
<form method="post" action="xxxx.php">
<div id="contact">
<div class="input_label user">
<label for="country">Pays</label>
</div>
<select ng-options="country for country in countries" name="country" ng-model="Country"></select>
</div>
<br>
<input type="submit">
</form>
</section>
這裏是選擇角碼
angular.module('commande',[]).controller('Sign_in',function Sign_in($scope, $element) {
$scope.countries = [
"Afghanistan","Afrique du Sud","Albanie","Algérie","Allemagne","Andorre","Angola","Antigua et Barbuda","Arabie saoudite","Argentine","Arménie",
"Australie","Autriche","Azerbaïdjan","Bahamas","Bahrein","Bangladesh","Barbade","Belgique","Bélize","Benin","Bhoutan","Biélorussie","Bolivie",
"Bosnie-Herzégovine","Botswana","Brésil","Brunei","Bulgarie","Burkina Faso","Burundi","Cambodge","Cameroun","Canada","Cap Vert","Centrafrique",
"Chili","Chine","Chypre","Colombie","Comores","Congo démocratique","Congo","Corée du Nord","Corée du Sud","Costa Rica","Côte d'Ivoire","Croatie",
"Cuba","Danemark","Djibouti","Dominique","RépubliqueDominicaine","Egypte","Emirats Arabes Unis","Equateur","Erythrée","Espagne","Estonie","Etats-Unis",
"Ethiopie","Fidji","Finlande","France","Gabon","Gambie","Géorgie","Ghana","Grèce","Grenade","Groenland","Guatémala","Guinée","Guinée Bissau",
"Guinée équatoriale","Guyana","Haïti","Honduras","Hong Kong","Hongrie","Inde","Indonésie","Irak","Iran","Irlande","Islande","Israël","Italie",
"Jamaïque","Japon","Jordanie","Kazakhstan","Kenya","Kirghizstan","Kiribati","Koweït","Laos","Lesotho","Lettonie","Liban","Liberia","Libye",
"Liechtenstein","Lituanie","Luxembourg","Macédoine","Madagascar","Malaisie","Malawi","Maldives","Mali","Malte","Maroc","Marshall","Maurice",
"Mauritanie","Mexique","Micronésie","Moldavie","Monaco","Mongolie","Mozambique","Myanmar","Namibie","Népal","Nicaragua","Niger","Nigeria",
"Norvège","Nouvelle Zélande","Oman","Ouganda","Ouzbekistan","Pakistan","Palau","Palestine","Panama","Papouasie - Nouvelle Guinée","Paraguay",
"Pays-Bas","Pérou","Philippines","Pologne","Porto Rico","Portugal","Qatar","Roumanie","Royaume-Uni","Russie","Rwanda","Saint Christophe et Nevis",
"Saint Vincent et les Grenadines","Sainte Lucie","Salomon","Salvador","Samoa","São Tomé et Príncipe","Sénégal","Seychelles","Sierra Leone","Singapour",
"Slovaquie","Slovénie","Somalie","Somaliland","Soudan","Sri Lanka","Suède","Suisse","Surinam","Syrie","Swaziland","Tadjikistan","Taïwan","Tanzanie",
"Tchad","Tchéquie","Thaïlande","Tibet","Timor Oriental","Togo","Tonga","Trinité et Tobago","Tunisie","Turkmenistan","Turquie","Tuvalu","Ukraine",
"Uruguay","Vanuatu","Vatican","Vénézuéla","Vietnam","Yémen","Yougoslavie","Zambie","Zimbabwe"
];
您如何驗證表單? – Grundy
我很確定錯誤不是來自表單驗證,無論如何我使用PDO '$ req = $ bdd-> prepare('INSERT INTO client_id(email,civilite,nom,prenom,date_naissance,adressse, code_postal,ville,pays) VALUES(?,?,?,?,?,?,?,?,?)' 或exit(print_r($ bdd-> errorInfo())); $ req->執行(陣列( '電子郵件'=> $電子郵件, 'civilite'=> $性別, 'NOM'=> $名, 'prenom'=> $姓名, 'date_naissance' => $生日, 'adressse'=> $地址, 'code_postal'=> $郵政編碼, '威樂'=> $城市, '支付'=> $國家 ));' –