Preserve Line Breaks
I've got the following code which should write the contents of a textarea to a '.txt' file:
Code:
set objFileSystem = server.createobject("Scripting.FileSystemObject")
set objFilePlainText = objFileSystem.CreateTextFile(server.mappath("templates/my-text-file.txt"),true)
objFilePlainText.write(strTemplatePlainText)
If I response.write this data before inserting to the txt file, it preserves the line breaks, but when it writes to the txt file it seems to lose all of the line breaks.
Does anyone know how to get this to preserve the formatting of the text being inserted?
View Replies
ADVERTISEMENT
Im developing a site for an organisation im a member of. Im trying to make updating the site a simple as possible for the organistions staff, some of which are not the computer literate. So i have made a kind of template site where the content of all the pages held in a access db. I have then made an admin backend where organisation staff can login and update the contents of pages simply by editing text in a text box and clicking the update button.
However, i've come across a problem. When users leave a line break in the text box the output page doesnt display the gap. I am using a simple response write to display the contents of the attribute on the page. Currently the only way im managing to get line breaks is to enter a '<br>' into the text box on the admin page.
How could i make it so when a line is left blank on the text box the database records this and displays it on the output page?
View Replies
View Related
I'm trying to save to a message field with the field type, memo.
Say I save the message:
"Test 1
Test 2
Test 3"
When I response.write it, it will turn out like " Test 1 Test 2 Test 3"
losing all the line breaks and such
If I response.write it within <textarea> </textarea> tags it comes back
View Replies
View Related
I created a form mail script. I am receiving an HTML email from the user input. However, If the user enters a line break in the comments field I am receiveing a single block of text in my email.
Is there a way to get the line breaks to show up in the email. I tried Wrap=physical in the input but its still the same.
View Replies
View Related
searched the forum many people posted the same thing many times about text areas displaying line breaks when data is retrived, i know this is the right code
<%=Replace(data, VBCrLf, "<br />")%>
but where abouts do i put this in my asp page.
View Replies
View Related
<%
response.write("Hi" & vbclrf)
response.write("there")
%>
There's no line break, it just displays it as Hithere.
View Replies
View Related
I'm storing information in a database that will later be displayed on the website and I have a questions about line breaks. My users will type in paragraphs into the text area. Then that information will be saved in an Access Database. Later it will be displayed on the website.
The only problem is that the line breaks that the user makes aren't stored in the DB, so when the information is displayed on the website it doesn't have that formatting (line breaks). I don't want to have to tell the user to type in <br> after each paragraph. What can I do to keep that formatting?
View Replies
View Related
Is it possible to create line breaks in a form? All of my informations appears as follows:
This mail message was sent from the www.ccbwebdesigns.com Online Form Email: First Name: John Last Name: Doe Business Type: Anonymous Business Name: In the Dark Phone: 555-GHOSTLY Mail: casper@haunted.com
I would like a line break after each individual text field.
Here is my ASP code....
View Replies
View Related
How is it you should format your ASP code to that when viewing the resulting
HTML text from the browsers "view code" it looks nice with line breaks?
View Replies
View Related
If I have a string and it contrins the following:
Hello world
how are you today?
What script will change it so the string contains?..
Hello world <br> how are you today?
View Replies
View Related
If i'am writing a post in a "textarea" and i use the ENTER (newline) on my keyboard it comes as a line break <br> in my post on the forum.PHP uses "nl2br", but what is the ASP solution for this?
View Replies
View Related
I have some text in my database with paragraphs in it.When I display that info from the database on my website using asp, it shows with out the paragraphs.Is there a function that will Inserts HTML line breaks before all newlines in a string?
View Replies
View Related
I'm using an ASP script to email a form using CDONTS. I'm trying to format the text in the email and for some reason the bottom line either shows up on the same line with the text or two lines down, instead of the line right below the text. What do I have to do to get it down to the next line? Code:
View Replies
View Related
i have a MySQL database and i am using ASP
for one of my forms, i have a textarea form element that is...substantially large (500x300px) users are instructed to hit enter/return on their keyboard to separate paragraphs but i have encountered a problem.
in the textarea, everything is wonderful. line breaks are clearly seen...its awesome. when i submit the form and when it writes to the database (the field is set as 'text'), everything is crammed together...there is just one space between where one paragraph ends and another begins.
has anyone encountered this problem before? does anyone know a solution?
View Replies
View Related
I'm trying to build an array with the ID's of the users I have in a Mysql table called tbl_user.
Here is what I coded :
dim listeId(1)
i = 0
Set rs=Conn.Execute("SELECT ID from tbl_user ORDER BY Id;")
Do While Not rs.EOF
if i = 0 then
listeId(i)= rs("ID")
else
REDIM PRESERVE listeId(i+1)
listeId(i)= rs("ID")
end if
i = i + 1
rs.MoveNext
Loop
rs.close
But I get this error: (0x800A000A)
which is something like "fixed or temporary locked array"
View Replies
View Related
How can I read back info from a database into an input field (in case it's to be edited) that will preserve the zeros to the right of the decimal?The zeros are being preserved in the access database when I have a look at it there. I have the field defined as type "Currency" to two decimal places.
I want to preserve those zeros to the right of the decimal point when I read the record into an input tag on a web page.I am trying to use "FormatCurrency(request.form(exp, 2))" and "FormatNumber(request.form(exp, 2))" but it doesn't help.
View Replies
View Related
Is it correct to think that after reducing the populated array's size from say, 10 to 5 with redim preserve myArray(i) an attempt to access an element above the fifth does not cause a compillation error "array out of script", but returns whatever heppened to
be written in that memory address (in particular it might return the correct values of those elements before re-dimentioning)?This seems to be the case in my code, yet I wanted to make sure that this isnot the result of some other side effect.
View Replies
View Related
I am implementing a site where an admin user can log purchases of items into a DB.
Obviouslt, one purchase can consist of many items. I am therefore trying to implement a 'Cart' idea wherby the user adds the items to be purchased to the cart and then completes the purchase once all items have been added to the cart.
i aM IMPLEMENTING THE CART FUNCTIONALITY VIA AN asp ARRAY. nOW I CAN Do THIS NO PROBLEM, APART FROM THE FACT THAT, i declare an array of size 10, with 5 attributes to each element. i.e.
Dim purchaseCart(10,4)
The problem is, i want to be able to ensure that if the user decides to purchase more then 10 items, that the array can be ReDimensioned to suit i.e. increase size by one every time another element is added, after it has reached its maximum size!! Code:
View Replies
View Related
I have a .asp form page that submits to another .asp page that uses cdonts to send me an email and does a response.redirect back to the form page. I need to preserve (keep) a couple of text box values and a couple of dropdown box values.
At this point I have global.asa variables for the fields in question and they are all set to null. I can't figure out how to put the contents back in the fields, when it returns from the cdonts page. I assume that I must save all the field values in the session variables just prior to the submit to the cdonts page.
show me how to accomplich this for one text field called name and one dropdown box called PUDeliv?
View Replies
View Related
I had created a macro to read data from an excel sheet and write the values to a text file. I had used "ActiveSheet.Range("GB" & k).Value" command to read the values from the excel.some cells in the excel sheet is having two lines value and four lines data, the text file is generating that value in a single line. (Ex. the cell value in address column is in four lines and should display in four lines in the text file generated from the macro)
Can i do something in the excel sheet or in vb script to read the address value line by line and write line by line in text file?
View Replies
View Related
I have an encrypted .txt file created by asp. Its formatted with lines etc. Title followed by description underneath. I need to read this into ASP now, and parse it line by line. On each line read, run the function to unencrpt and add line to a new file.
Its the line by line Im having trouble with. If i do the full textstream no formatting takes place coz im adding the fulltextstream all in one addline call. How can I loop through lines ?
View Replies
View Related
REDIM Preserve reports an "out of range".
I first create an array, store it into a session var then, in other page, I load restore the session var into a local array but, after this, I can't REDIM Preserve.
View Replies
View Related
In one of our applications we have product id field which sometime contains ' . When doing a search the sql breaks due to this. I cannot use replace function to remove this is there anything else I can do so that this works
strProductId = 2277'778
sqlstr = " Select * from productdetails where id ='" & strProductId & "'"
In this instance the sql breaks and gives me an error. how i can solve this.
View Replies
View Related
this might be a shot in the dark but does anyone know if there is way to code pdf page breaks in webpages. when i print to adobe acrobat my webpages split when there converted to pdf. i want to set the pdf page breaks in my webpage.
View Replies
View Related
i am generating report in ASP using sql.but i have problem when i need to have print ,that is when i want to take a printout of whole data i want to break the pages according to the group,but now i get a report with merging of the data.I want to take a print out groupwise page break. sample asp file is attached with this mail .
View Replies
View Related
Preparing a report form in word file using ASP.
How to insert page breaks in word file through ASP to perform a
client side report.
View Replies
View Related
I've 300 records in a recordset sort by name column (not unique) needs showing in 3 pages, 100 records each. At this moment i've stored records having 1 to 100 ID in 1st page, 100 to 200 id in second page and 201 to 300 in third page. but this doesn't have the record sorted actually according to name. Can anyone suggest how i can break records in 3 pages as well as sort them according to name.
View Replies
View Related
I am creating some reports with ASP and have come to a bit of a problem. Does anyone know how can I send a page break to the printer? I need to be able to start different items fresh on a new page and I really have no idea how to do it.
View Replies
View Related
I am building a small CMS for my son's school. Ideally I want to build the system for them and hand it over so that all updates can be done through web-based forms.
So far so good. However I'm having a problem with fields designed to take multi-paragraph stories or articles. I'm using a text area field on the form which saves the data in a memo field in the database. Teachers would typically cut and paste stories from word documents into the text area field.
However when the data is loaded back into the website from the database all the carriage returns have been removed and the story consists of one long paragraph.
View Replies
View Related
Can anyone please let me know how to insert page numbers and page breaks in ASP.
View Replies
View Related
I am trying to modify an existing ASP application that produces forms with several 'blocks' of text that are contained within table cells and which have their own HTML id's.
These blocks must not be split over two pages. Is there a straightforward way of calculating the size of each block/table cell so that the blocks are not split and the form prints on the minimum number of pages? This is an intranet application, so we have a certain amount of control over browser settings, so margin settings etc are not a problem.
View Replies
View Related
We have a page that reads records from a database and displays them. Basically name/address/city/state/zip/county/phone. These records are between 4-6 lines a piece (there are other variables involved).
When printing these records via i.e. we currently have a process where we determine how many records have been written and eventually put a table with .break { page-break-after: always } style applied to it. The problem is, sometimes a page will hold 14 records, sometimes 15, sometimes 16. Is there a better approach to this so that records don't get cut off and it maximizes the number of records that display on each page?
View Replies
View Related
I have used this type of VBSCRIPT code on an ASP page for several years to launch a program on a server from an ASP page:
Dim sh
set sh = Server.CreateObject("WScript.Shell")
sh.Run("any-program.exe", 0 , TRUE)
The code breaks when I installed Internet Explorer 7 (IE7) on a Windows 2003 Server. The error is "permission denied". The error goes away when I uninstall IE7. Have you run into this problem? Do you have a solution that is better than uninstalling IE7?
View Replies
View Related