嗨,我正在创建一个 angularJs 应用程序。表单工作正常,但单选按钮不会出现。我只能看到标签,但看不到实际的按钮。我已按照网上说明进行操作,但它似乎被隐藏了。我正在尝试创建一组 6 个单选按钮,用户只需选择一个按钮。
下面是其中一种表单部分。
谢谢
<div>
<div class="form-wrapper">
<p>Choose a fund</p>
<br>
To help you decide which fund is right for you, we've provided a summary of each below.
<br>
Simply click on the magnifying glass to view the individual fund details.
<br>
You can also compare all funds in this risk category using the fund comparison button at the bottom.
<br>
When you've reviewed your options and have made your choice, click 'select'.
<br>
<br>
<!-- <form class="form-horizontal" role="form">-->
<!-- <div class=" form-group">-->
<!-- <div class="col-sm-6">-->
<!-- <div class="form-group">-->
<label for="pearRadio">SEI Balanced Fund</label>
<input id="pearRadio" type="radio" ng-model="fruitValue" value="pear" /><br />
<label for="peachRadio">7IM AAP Balanced Acc Strategy</label>
<input id="peachRadio" type="radio" ng-model="fruitValue" value="peach" /><br />
<label for="apricotRadio">Close Balanced Portfolio Fund Accumulation</label>
<input id="apricotRadio" type="radio" ng-model="fruitValue" value="apricot" /><br />
<label for="pearRadio">Allianz RiskMaster Moderate</label>
<input id="pearRadio" type="radio" ng-model="fruitValue" value="pear" /><br />
<label for="peachRadio">Schroder MM Diversity Balanced Fund Accumulation</label>
<input id="peachRadio" type="radio" ng-model="fruitValue" value="peach" /><br />
<label for="apricotRadio">Goldman Sachs Dynamic</label>
<input id="apricotRadio" type="radio" ng-model="fruitValue" value="apricot" /><br />
<br />
<strong>Selected Fund:</strong> {{fruitValue}}
</div>
<button class="btn btn-primary"
ng-click="goToNextState('form.account')">Next</button>
</form>
</div>
</div>
最佳答案
首先,如果您愿意,请不要重复值 用户仅选择一个单选按钮。
检查 .form-wrapper 类 css 属性,也许 输入不透明度为 0 或不显示...
我根据您的代码制作了一个演示并且运行良好:
<input id="pearRadio1" type="radio" ng-model="fruitValue" value="pear1" />
我对这些值进行了一些更改。
关于javascript - angularJs 单选按钮不可见?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27705291/