NetTalk Web Server > Web Server - Ask For Help
NT12 apostophe in browse forms - solved
(1/1)
DonnEdwards:
I noticed some bad punctuation in some of my imported data, so I ran a filter using StringTheory to remove any strange characters:
stname.SetValue(stline.GetLine(12)) ! STRING(200) !Section Name
stname.replace('"','') ! Remove extra quotes in data
stname.replace('`','''') ! fix bad punctuation
stname.replace('\','/') ! fix bad punctuation
stname.KeepChars('0123456789 .,''&ABCDEFGHIJKLMNOPQRSTUVWXYZ-/:;!@#$%^&*()+?') ! Remove weird data
stname.replace(',',', ') ! fix bad punctuation
stname.replace(' ',' ') ! fix bad punctuation
mp:section_name = CLIP(LEFT(stname.GetValue()))
All the text data is in upper case. If I look at it in a Clarion ABC app, the attached image 1 shows the data as it appears in the tables.
If I display the same TPS file in a NT web server browse form, I get the second image. Wherever there is a normal apostophe (Character 39) it is displayed as ', which is weird because HTML is supposed to regard this as an HTML Entity
I have to restrain myself from editing ATTORNEY'S to the correct ATTORNEYS but that's another matter :-) Also, the "Change" form doesn't show the ', only the browse form.
So what is going on? How do I fix it? Is this a bug in NT 12.19 or have I broken something?
DonRidley:
Looks like the server is converting the character to an HTML entity.
I wonder if you could do a stname.Replace(''','<39>') instead of stname.replace('`','''') if it take care of it.
You may have to do it at runtime in the NT browse when it creates that cell.
Good luck,
Don
DonnEdwards:
--- Quote from: DonRidley on June 11, 2021, 02:29:03 AM ---Looks like the server is converting the character to an HTML entity.
--- End quote ---
What I don't understand is why the entity is not displayed correctly. It only does it with the apostrophe, but not the ampersand?
Normally a browser would expect &apos; if I wanted to display the entity phrase instead of the actual entity character.
What does this mean?
Fix: Added ' to _jsok.
I suspect it may have something to do with the issue, but no idea what.
jking:
Donn,
I see something similar in my NT 12.19 browses. I solved it by setting the "Allow xHTML in column" check box on the column tab. See attached image.
Thanks,
Jeff
DonnEdwards:
--- Quote from: jking on June 12, 2021, 08:55:03 AM --- I solved it by setting the "Allow xHTML in column" check box on the column tab.
--- End quote ---
Jeff, you're a star! Thank you very much. My understanding of NT forms has also grown.
Best wishes
Donn
Navigation
[0] Message Index
Go to full version