• Post Reply Bookmark Topic Watch Topic
  • New Topic

JSTL C:out value not working properly in Input Box value setting

 
Rajibul Alam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I am trying to create an Edit profile page. Thus I get the Users previous attributes value using a simple select query then setting the values like the following

<c :forEach var="currentRow" items="${selectedRows.rows}">
<c: set var="Last" value="${currentRow.Last}" />
<c: set var="First" value="${currentRow.First}" />
<c: set var="Address1" value="${currentRow.Address1}" />
<c: out value="${currentRow.Address1}" />
<c: out value="${Address1}" />
<c: set var="City" value="${currentRow.City}" />
<c: set var="State" value="${currentRow.State}" />
<c: set var="Zip" value="${currentRow.Zip}" />
<c: set var="Phone" value="${currentRow.Phone}" />
<c: out value="${currentRow.Phone}" /> // printing out to see if I am getting the values right or not .....and they show the right values
<c: out value="${Phone}" />
</c :forEach>

But when I try to do the following
<TR>
<TD ALIGN=RIGHT>Phone </TD>
<TD ALIGN=LEFT><INPUT TYPE=TEXT NAME="Phone" size="14" value=<c: out value="${Phone}"/> ></TD>
</TR>

instead of giving me (123) 456-7890 it shows only (123) in the INput text box.

Can anyone please tell me the reason why or How do I fix it.

I have also printed out the value like this <TD ALIGN=RIGHT>Phone <c: out value="${Phone}"/> </TD>

and it did give the right value next to the Phone text but not in the Input box

Thanks in Advance

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It needs to be in quotes.
 
Rajibul Alam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:It needs to be in quotes.


thanks for the reply

do you mean it needs to be in quotes like this

<td ><INPUT TYPE=TEXT NAME="Phone" size="14" value="<c: out value="${Phone}"/"> ></td>


Works....thanks a lot.....
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65516
105
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When things like this happen, look at the HTML source sent to the browser. The problem could have been seen in seconds.
 
Rajibul Alam
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:When things like this happen, look at the HTML source sent to the browser. The problem could have been seen in seconds.


thanks for the tip....really appreciate it
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!