我有这种HTML表单,它在输入框中显示了一些不切实际的数字。顺便说一下,我在输入框中获得的数据来自数据库。我想在输入框中显示一个“NA”而不是99999999.9999的值。我不知道是否有一条if语句可以帮助我解决这个问题。如何在HTML表单中的输入框中显示不同的值
<form id="new-inventory-item-form" action="#" formaction="process" data-ajax="false">
<h3> Assets</h3>
<div class="ui-block-a">
<label for="longitude">Longitude</label>
<input type="number" name="" id="longitude" value="9999999.99999999">
</div>
<div class="ui-block-b">
<label for="size">Latitude</label>
<input type="text" name="" id="latitude" value="9999999.99999999">
</div>
</form>
在什么时候,你考虑的值是“不现实的”? –
你好,我想帮忙,但我不明白你需要什么...你能更具体吗? –
如果这是始终从数据库中返回的数字,只需对其进行测试,如果为true,则将其替换为“N/A”。 – AlexGM