开发者

Insert line breaks in hidden fields value - Java

How would I go about inserting line breaks in the value of hidden fields?

For ex. this is how my hidden field looks like:

<input type="hidden" name="dahidden" value="<%=da.getFname() %> <%=da.getLname() %> <%=da.getEmail() %> <%=da.getPhone() %> <%=da.getExt() %>">

I tried the following:

value="<%=da.getFname() %> <%=da.getLname() %> \n <%=da.getEmail() %> ..." 

value="<%=da.getFname() %> <%=da.getLname() %> '\n' <%开发者_Python百科=da.getEmail() %>..." 

value="<%=da.getFname() %> <%=da.getLname() %> <br> <%=da.getEmail() %>..."

But all of them don't actually resolve to the newline character, and get displayed as \n, '\n', and

respectively.

Thanks,

Pritish


Just insert them plain.

<input type="hidden" value="<%=da.getFname() %>
<%=da.getLname() %>
<%=da.getEmail() %>">

That said, have you considered taglibs/EL? Scriptlets are discrouaged since a decade. If you've learnt them from some book/tutorial, I think it's high time to replace it by a more decent/recent one to avoid future troubles.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜