April 2, 200322 yr So i thougth i solved my problem, guess i did not. This is the situation. One of my fields in a database contains special characters, circumflex, grave accent, etc). I read this variables: var1="[FMP-Field: textfield,Break]" When i display var1 in my browser : window.document.myform1.tekstveld1.value=var1 the text is scrambled. for example i see codes like this : ë I have been playing with the field encoding and with escape/unescape function. How should i proceed now? For example i can change all the special characters in the filemaker field with their code, but what code? Any help is welcome Jitse
April 2, 200322 yr Have you tried the various ways of showing a field: var1="[FMP-Field: textfield,raw]" var1="[FMP-Field: textfield,format]" Good Luck. Garry
April 3, 200322 yr Author Thanks gary, indeed i tried that combination. Now i have made my own javascript encode function. This is a sample that only changes the dieresus (umlaut mark). Offcourse this code can be used for all ASCII characters. Jitse function encodestrings(encodestr){ var locstr locstr=encodestr while(locstr.search("ë")!=-1){ locstr=locstr.replace("ë",String.fromCharCode(235)) } return locstr }
April 3, 200322 yr Author Now this is the complete function (that i think does the job) function encodestrings(encodestr){ var locstr var codestr var code var i =0 var k =0 locstr=encodestr while (i !=-1) { i = encodestr.indexOf("&#",i) k = encodestr.indexOf(";",i) if (i!=-1){ codestr=encodestr.substr(i+2,k-i-2) encodestr=encodestr.replace("&#"+codestr+";",String.fromCharCode(codestr)) i=i+1 } } while(encodestr.search("<br>")!=-1){ encodestr=encodestr.replace("<br>","n") } return encodestr } Jitse
April 4, 200322 yr Have you tried something like this: document.write(unescape("[FMP-Field:textfield]"); Good Luck. Garry
April 7, 200322 yr Author Thanks Gary, Indeed i have tried unescape, to no avail. until now the javascript works good. Greetings Jitse
Create an account or sign in to comment