<td class="altbg1" align="center" nowrap="nowrap">
<%=u.getUserName()%>
</td>
这种方式得到的用户名中如果有空格 能全部显示出来
<td class="altbg1" align="center" nowrap="nowrap">
      <input type = text name = username value=<%=u.getUserName()%>>
</td>
这种方式得到的用户名如果有空格则 只能显示空格前的部分
为什么?如何让text里的内容全部展现出来

解决方案 »

  1.   

    value= "<%=u.getUserName()%>"
      

  2.   

    <input type = text name = username value= '<%=u.getUserName()%>'> 
    加上引号
      

  3.   

    html 标签 属性 严格来说  需要用双引号 引起来<input type="text" name="username" value="<%=u.getUserName()%>" /> 而且要有 /> 或者 </***> 结束的
      

  4.   

    <input type = "text" name = "username" value= "<%=u.getUserName()%>">