Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何在输入框中显示特定条件下的空白字段_Html_Mysql_Jsp - Fatal编程技术网

Html 如何在输入框中显示特定条件下的空白字段

Html 如何在输入框中显示特定条件下的空白字段,html,mysql,jsp,Html,Mysql,Jsp,我已经在mysql表的bigint中存储了电话号码。默认情况下,它将字段设置为0。 页面加载时,所有其他输入字段均为空,但电话号码字段显示0。 我剩下的唯一选择是将数据库表中的电话号码字段设置为varchar 当数据库中的电话号码为0时,如何显示空输入字段 <tr> <td>Primary Phone</td> <td><input type="text" name = "primaryPhone" i

我已经在mysql表的bigint中存储了电话号码。默认情况下,它将字段设置为0。 页面加载时,所有其他输入字段均为空,但电话号码字段显示0。 我剩下的唯一选择是将数据库表中的电话号码字段设置为varchar

当数据库中的电话号码为0时,如何显示空输入字段

    <tr>
        <td>Primary Phone</td>
        <td><input type="text" name = "primaryPhone" id="primaryPhone"
                    path="userContacts.primaryPhone"  maxlength="20" size="50" />     </td></tr>

主电话

请提供帮助。

如何将数据从mysql显示为html?例如,如果您使用php,您可以很容易地提到if-conditional,这将为html输出空白。数据绑定在表单对象中。我错过了path=“userContact.primaryPhone”。更新了代码abpve。您有从数据库获取数据的查询吗?我正在使用hibernate load。您可以在查询中使用if(条件,则不然),但我认为您应该将数据库中的电话号码字段设置为varchar。只有当你要做一些数学计算时,你才需要数字类型。