p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

proasp_codeclinic thread: Single quote in field is causing Response.Write to truncate contents


Message #1 by "Raymond Gonsalves" <raymond.gonsalves@v...> on Tue, 5 Mar 2002 19:57:53
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C1C49B.E92AB630
Content-Type: text/plain

It is standard to write HTML with ", rather then '. That said ' is
supported. Now the problem is that the generated HTML is:

<TD WIDTH='608'><INPUT id=projtitle name=projtitle style='WIDTH:608px;
HEIGHT: 22px' size=94 value='Project's Title'</TD>"

Now I see a few problems:

1. You don't have a > on the end of your <input> tag.
2. You don't need the .value.
3. You need to escape the ' in the value property. Change your code to the
following:

Response.Write "<TD WIDTH='608'><INPUT id=projtitle name=projtitle 
style='WIDTH:608px; HEIGHT: 22px' size=94 value='" & 
Server.HTMLEncode(adoRS9("projtitle")) & "'</TD>"

regards
David Cameron
nOw.b2b
dcameron@i...

-----Original Message-----
From: Raymond Gonsalves [mailto:raymond.gonsalves@v...]
Sent: Wednesday, 6 March 2002 6:58 AM
To: Code Clinic
Subject: [proasp_codeclinic] Single quote in field is causing
Response.Write to truncate contents


Hello All,

The following code should take eg. Project's Title form the recordset and 
place it in an HTML input box. However because of the single quote it 
truncates the field: 

It places "Project" in the HTML input box instead of "Project's Title"

Here's the code:


Response.Write "<TD WIDTH='608'><INPUT id=projtitle name=projtitle 
style='WIDTH:608px; HEIGHT: 22px' size=94 value='" & adoRS9
("projtitle").value & "'</TD>"


Any help would be greatly appreciated.

Thank you,
Raymond Gonsalves
Rye, NY
$subst('Email.Unsub').


  Return to Index