Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Two Quick Questions 1

Status
Not open for further replies.

JezEling

IS-IT--Management
Mar 22, 2004
127
0
0
GB
Hi All,

I just have two quick questions which are probably really easy to answer: -

1) I have a text area on an ASP page which stores the text in an SQL database. I want the users to be able to press enter etc. to start new paragraphs. However when I retrieve the information to display on a different form non of the formatting is retained. Is there a workaround or a better way to achieve this.

2) I have a query that returns an address from a database and then sends the information to a form that populates certain fields, if no address is returned I get a nasty error that I don't really want the users to see, how can I get around this.

Many Thanks in advance

Jez
 
1. you need to use Replace() function to replace tabs, spaces.

2.

if rs.EOF AND rs.EOF then
response.write "no records found"
else
'do the form population here
end if


or you can just have...

if rs("address")<>"" Then

-DNG
 
The problem is that HTML sees carriage return/line feed, tab, and multiple spaces as plain white space.

So, like DNG says you need to replace vbCrLf with <BR> and tab with something like &nbsp;&nbsp;&nbsp;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top