• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Text box value is not being completely filled with request attribute

 
Mishaal Khan
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

In a jsp,I am trying to fill the text box value from a request attribute i.e

Seller user = (Seller)request.getAttribute("seller");

<INPUT type="text" name="firstname" <% if (user != null) { %> value = <%= user.getCountry() %> <% } %>size="50" />

whats happening is it is displaying value only before the space ,for example if country is United States,its displaying only United,same thing is happening with other fields too.

Am I missing something ?Please advice.

Thanks.
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this,

 
Mishaal Khan
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.This logic is not applicable as it is displaying text box with value only if user is not null,whereas I need to display the text box in any case.Also even if i use this logic,its still not displaying the complete value.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look at the resulting HTML using View Source in your browser. What's missing? You should see it easily.
 
Mishaal Khan
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I checked the source,it has complete value i.e

<INPUT type="text" name="location" value = united states size="70" />

if I am displaying the value without text box,using only
<%= user.getCountry() %>, its displaying complete value but in text box its displaying incomplete value.
[ December 15, 2008: Message edited by: Mishaal Khan ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't notice anything missing from that line? Really? Look closer!
 
Mishaal Khan
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am embarrassed for being so harrassed that couldn't notice the " " marks around value

Thanks, its working now!
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64720
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But I suspect that you'll never make that same mistake again!
 
Mishaal Khan
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will not !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic