Solved

Form <Input ...> display problem

Posted on 2002-04-07
2
172 Views
Last Modified: 2012-05-04
Hi

I have problem with a jsp program which display
a form's input field.

See below :-

out.print("<td><input type=text size=60 name=description disabled value=" + desc + ">" + "</td>");          

The String field <desc> contains value "Question 3 header".
But when the web page displayed, it shown as "Question" instead of "Question 3 header".

Pls advice what is wrong ?

Thanks & Rgds
Heng03

                                   

0
Comment
Question by:heng03
2 Comments
 
LVL 3

Accepted Solution

by:
msterjev earned 100 total points
ID: 6924047
Increase the size of text field and specify the width of the column:
<td width=200><input type=text size=120 .....
0
 

Author Comment

by:heng03
ID: 6924497
Hi  msterjev

Your answer did not work.

I debug the jsp program & found the error is due to jsp handling String variable.
The solution is to embed the variable with "'".

eg
before solution :-
out.print("<td><input type=text size=60 name=description disabled value=" + desc + ">" + "</td>");  
       

After solution :-
out.print("<td>" + "<input type=text size=60 name=description disabled value=" + "'" + desc + "'" + ">" + "</td>");  
       
Anyway thanks for your help.

Rgds
Heng03





0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now