September 3, 2008 at 2:36 pm
I am coding a little web application. It isn't large at all and still has some bugs. It is my first attempt at AJAX.
I start by displaying some html with a bit of javascript.
I then shoot it over to some ASP and then to SQL.
So, I have a text area and I want to preserve the format so I can display it as they put it in. So, the flow is like this when they hit an edit button...
html>javascript>vb>tsql 'This gets it from the page to the database in the first place
tsql>vb>html>javascript>html 'The html>javascript>html is because I use AJAX to recapture the data to put it into an editable text area.
All of the above is really just to confuse you as much as me. 🙂
The real question is how do I manipulate the string as I pass it around? I forgot to mention up there that I am also scrubbing the string so I can send it through the url. Carrige Returns are my biggest problem at the moment. I know about using char(10) and char(13) but I have read that I would be better off without putting that into the data.
Anyone else code web applications that can share their preferred methods? I am kind of looking for best practices sort of an answer. I want to know how to do this the correct way and not just a work around.
September 3, 2008 at 4:06 pm
Your best bet might be to simply pick some sequence of characters that won't ever happen, and use that as your "carriage return". At which point you strip out the real carriage returns during the "in transit" steps, and put them back in right before you either insert into the DB or right before you put it in the text box.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply