Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.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
Input 占位符输入字段不显示值?_Input_Session Variables_Placeholder - Fatal编程技术网

Input 占位符输入字段不显示值?

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我也在其他浏览

我有一个带有占位符的输入框,我正在通过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我也在其他浏览器上试用过,但不起作用,我正在使用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">