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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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