Input 占位符输入字段不显示值?
我有一个带有占位符的输入框,我正在通过php中的会话变量设置此字段中的值 这是我写的代码:Input 占位符输入字段不显示值?,input,session-variables,placeholder,Input,Session Variables,Placeholder,我有一个带有占位符的输入框,我正在通过php中的会话变量设置此字段中的值 这是我写的代码: <input type="text" value=<?=$_SESSION['no_of_persons']?> name="no_of_persons" id="no_of_persons" placeholder="No. of Person(s)" maxlength="3" /> 您尝试过其他浏览器吗?您使用的是什么DOCTYPE?@FabianLauer我也在其他浏览
<input type="text" value=<?=$_SESSION['no_of_persons']?> name="no_of_persons" id="no_of_persons" placeholder="No. of Person(s)" maxlength="3" />
您尝试过其他浏览器吗?您使用的是什么DOCTYPE?@FabianLauer我也在其他浏览器上试用过,但不起作用,我正在使用DOCTYPE刚才看到了一些东西:尝试将
包装成双QOUTS:value=”“
@FabianLauer我也试用过,但没有成功(我做到了。@FabianLauer我刚刚更改了id和名称,现在一切正常
<input id="no_of_persons" type="text" maxlength="3" placeholder="No. of Person(s)" name="no_of_persons" value="7">