admin管理员组文章数量:1302341
I have used bootstrap 4 framework in my website. Using this framework I have created a simple html form using bootstrap class with javascript function.
The form works good while i enter integer as input, But it shows some error while i enter float vales.
Here is the web-page.
<form role="form" name="BeamFactor">
<div class="form-group">
<label>Antenna dimension (D) :</label>
<input class="form-control input-lg" name="n1" required="" type="number">
</div>
<div class="form-group">
<label>Wavelength (λ) :</label><input class="form-control input-lg" name="n2" type="number">
</div>
<div class="form-group">
<label>Beamwidth :</label><input class="form-control input-lg" name="n3" type="number">
</div>
<div class="form-group">
<input value="Calculate" class="btn btn-success btn-lg" onclick="javascript:calcBeamFactor();" type="button">
<button type="reset" class="btn btn-warning btn-lg">Reset</button>
</div>
<div class="form-group">
<label>BF :</label><input class="form-control input-lg" name="total">
</div>
</form>
I have used bootstrap 4 framework in my website. Using this framework I have created a simple html form using bootstrap class with javascript function.
The form works good while i enter integer as input, But it shows some error while i enter float vales.
Here is the web-page.
<form role="form" name="BeamFactor">
<div class="form-group">
<label>Antenna dimension (D) :</label>
<input class="form-control input-lg" name="n1" required="" type="number">
</div>
<div class="form-group">
<label>Wavelength (λ) :</label><input class="form-control input-lg" name="n2" type="number">
</div>
<div class="form-group">
<label>Beamwidth :</label><input class="form-control input-lg" name="n3" type="number">
</div>
<div class="form-group">
<input value="Calculate" class="btn btn-success btn-lg" onclick="javascript:calcBeamFactor();" type="button">
<button type="reset" class="btn btn-warning btn-lg">Reset</button>
</div>
<div class="form-group">
<label>BF :</label><input class="form-control input-lg" name="total">
</div>
</form>
Share
Improve this question
edited Jul 5, 2019 at 15:24
Sandy DK
asked Sep 29, 2017 at 14:29
Sandy DKSandy DK
831 silver badge6 bronze badges
1 Answer
Reset to default 9Add step property to your input type.
<input type="number" step="any" />
本文标签: javascriptBootstrap Form Input Float Value IssueStack Overflow
版权声明:本文标题:javascript - Bootstrap Form Input Float Value Issue - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741687236a2392511.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论