Link to home
Start Free TrialLog in
Avatar of heng03
heng03

asked on

Form <Input ...> display problem

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

                                   

ASKER CERTIFIED SOLUTION
Avatar of msterjev
msterjev

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of heng03
heng03

ASKER

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