tags:

views:

42

answers:

1

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' <%=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

+1  A: 

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.

BalusC