Variable concatation
hey all,
I am fetching a data from SQL DB and displaying into the textboxes in Servlets. But for name, only First name is coming up and Last name itself is getting trunketed. i.e. instead of Amitabh Bachchan in testbox it is coming Amitabh only and Bachchan getting cut off.
I am using folowing expression :
out.println("<td><input type=text name=\"empl_name\" align=\"left\" size = \"30\" value="+ e_nm_db +">"+e_nm_db+"</td>");
here e_nm_db inside the input command giving only First name but outside that is giving Full name perfectly.
Can any1 help me regarding this?
thax & rgds,
nhb007
[662 byte] By [
nhb007a] at [2007-10-3 9:19:38]

hey alban.maillere,I didn`t get wt u meant to say...Currently my value is "Amitabh Bachchan" then why and how it is cutting it off? can u tell me directly that only?thax & rgds,nhb007
because without quotes around attributes, the space is considered as the end marker of the value
seriously : in your code juste put System. before your code
System.out.println("<td><input type=text name=\"empl_name\" align=\"left\" size = \"30\" value="+ e_nm_db +">"+e_nm_db+"</td>");
on the console you'll see
<td><input type=text name="empl_name" align="left" size = "30" value=Amitabh Bachchan>Amitabh Bachchan</td>
and that is WRONG html
Hey alban,
U r right, that in System it is showing perfectly fine, but here outside input tag I`ve put, is just to have idea that what actually is Data and inside input is what it prints.
So can u temme how to avoid this? I know I might b irritating but I m new to this so have lots of Qs and queries...:)
thax & rgds,
nhb007
hey alban.maillere,Geneius man...Hurray!!!! thax buddy, it worked perfectly.thax & rgds,nhb007