textarea not displaying data properly (solved)
7 posts
• Page 1 of 1
textarea not displaying data properly (solved)I have set up a field to show a textarea type widget, and data is entered into the field, saved to the database, but when the record is viewed in edit mode, the data does not display... I can't find anyone with a related issue - maybe there is some setting I need to know about for this? Right now it is kind of a big problem, because if someone edits the record later, the data that was saved is now cleared out (presumably because the field is blank in the edit view)...
Last edited by casanovax7 on Thu Oct 04, 2012 2:22 pm, edited 1 time in total.
Re: textarea not displaying data past 300 charactersI figured out the issue. It was not a text length issue, but one of characters: you’ll feel like you've - the first apostrophe is what Word types, and the second is what a browser or notepad types. The first does not work in my database and causes the data to not appear in the browser when someone pasted it into the textarea and then saved the record.
Does anybody know the best way for me to automatically replace all ’ with ' ? I would assume some kind of delegate class that goes through the whole record before being saved and replaces everything would be best, but if anybody has any shortcuts for that, I'd really appreciate it... Thanks!
Re: textarea not displaying data past 300 charactersI have seen this before, but don't recall what the solution was. You might try to play with the encodings
e.g. default_oe and default_ie directives in the conf.ini file.
Re: textarea not displaying data past 300 charactersJust wanted to follow up on this and leave a message in case anybody else in the future has this issue.
To recap: I built a database utilizing Xataface as the front end for the sole purpose of collecting, sorting, and revising text and image data on vendors my company uses (this data would put uploaded to another system later). We have about 7 people working on this all the time, and some people were writing descriptions in Word and then copying and pasting into Xataface. An issue arose when hyphens or single/double quote or ellipses were used because they come over from Word as different characters. The data was being stored in the database properly, but when someone would edit the same record later, the data would not show up in the textarea widget, and if the record was saved, the data was deleted. I played around with encodings and anything else I could think of to try to get the data to show up when these symbols were present, but to no avail. I finally decided to simply do a find/replace for each of the characters every time the record was saved. It took FOREVER to find a proper and easily implemented solution, but eventually I did. Below is the code I use to rid the data of the crappy Word characters:
I created queries for each field that needed it (for me that was 7) and simply changed out the field name in the query and iterated my variables (so $sql2 and $res2, etc.), and it now works just perfect. Sorry for the long post on an old topic, but Xataface has been an absolute life-saver when it comes to our project and this aspect of it took me the longest; hopefully someone finds this useful in the future!
Re: textarea not displaying data properly (solved)Thanks for posting this. Now, the million dollar question is why these characters are causing the MySQL connection to choke.
Re: textarea not displaying data properly (solved)Hello,
The trouble is not with MySQL, but with word "smart quote". There a few post about it, but no true and definitive solution http://www.toao.net/48-replacing-smart-quotes-and-em-dashes-in-mysql http://www.codingforums.com/archive/index.php/t-47163.html You also have the solution to install Open office...
Re: textarea not displaying data properly (solved)Haha, yeah, I tried to get everybody to install OpenOffice but was put in my place shortly thereafter. I think that's the solution when you only have a couple people working, but we have about 7-10 people working on stuff at any given time and I think everybody who uses Word is happy with it (and doesn't want to install more software).
Still, I think it's funny you mention the first thing I tried; totally forgot to mention it myself!
7 posts
• Page 1 of 1
Who is onlineUsers browsing this forum: No registered users and 1 guest |