<select name="test1" ng-model="test11" ng-init="test11=0">
<option value="MULTIMETER" ng-value="60"></option>
</select>
当我从PHP: $test = $_POST['test1'];
获得值时,它给出值60 (ng-value=0)。我想要得到'MULTIMETER'
的值。如何解决这个问题?
case 1:在test11中,当选择MULTIMETER时,model值为60
<select name="test1" ng-model="test11" ng-init="test11=0">
<option ng-value="60">MULTIMETER</option>
</select>
情况2:在test11中,当选择60时,模型值为MULTIMETER
<select name="test1" ng-model="test11" ng-init="test11=0">
<option ng-value="MULTIMETER">60</option>
</select>
情况3:在test11中,当选择60时,模型值为MULTIMETER默认选择
<select name="test1" ng-model="test11" ng-init="test11=0">
<option ng-selected="true" ng-value="MULTIMETER">60</option>
</select>
案例4:Try it
<select name="test1" ng-model="test11">
<option ng-selected="true" ng-value="MULTIMETER">MULTIMETER</option>
</select>