text box only displaying one word as value

若如初见. 提交于 2019-12-24 16:25:42

问题


Can anyone help me understand why a text box won't display a whole string opposed to just the first word? For example if the value of Name is "John Smith", the text box will display "John"

echo "<td>" . "<input type = text name = name value =" . $record['Name'] . " </td>" ;


回答1:


Thats because you did not quote your attribute value, without quotes spaces terminate the attribute value

echo "<td><input type = text name = name value =\"" . $record['Name'] . "\" ></td>" ;


来源:https://stackoverflow.com/questions/34466145/text-box-only-displaying-one-word-as-value

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!