UrKo Posted August 15, 2009 Posted August 15, 2009 Hi, I'm using this code to put breaklines in asp:textbox, but the thing i don't like is, that when i edit the data, the br are seen. <script type="text/javascript"> <!-- function changeTextBoxValue(elementRef) { var textBoxValue = elementRef.value; while (true) { var currentValue = textBoxValue; textBoxValue = textBoxValue.replace('\n', '<br />'); if (textBoxValue == currentValue) break; } elementRef.value = textBoxValue; } // --> </script> does anyone has a better code and that are saved in db, but if you edit the data text will be in next line but without <br> Quote
Cags Posted August 28, 2009 Posted August 28, 2009 Can you not simply run the replace code only when you output the data from the database? So it will be stored in your db as \r\n or whatever, but before you output the data you replace that value in the string you fetched from the db. Quote Anybody looking for a graduate programmer (Midlands, England)?
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.