karker Posted April 21, 2011 Share Posted April 21, 2011 hi users good works i have charecter problem pls help me it for js or php problem .. if i inserting data to mysql the charecters are changing new bad charecters <div id="usercomment2" style="color:#666666; font-weight:bold;cursor:pointer" onclick="akedit('islem_kayit.php?mode=eg2&id=<?php echo $mesaj['id']; ?>','usercomment2',{ type : 'textarea', name : 'usercomment2', width: '300px', height: '150px', submit:'kaydet' });"> <?php echo $mesaj['mesaj_degisken']; // here i am geting data from mysql and i want use saving place ?> </div> and its in the down JS file akeditable.js unction akedit(url,element_id,settings) { if(document.getElementById('frm'+element_id)) return false; //form is already thier so no need to do it again. 10:40 PM 1/4/2008 amit singh if(document.getElementById('akebutton')) reset(old_content,objtoedit);//another button is already their so reset the content as new 'Edit' has been clicked. objtoedit=document.getElementById(element_id); old_content=objtoedit.innerHTML.replace("\r\n",""); objtoedit.innerHTML=''; //create textbox or textarea /* create the form object */ var f = document.createElement('form'); f.id='frm'+element_id; /* main input element */ var i; if ('textarea' == settings.type) { i = document.createElement('textarea'); if (settings.rows) { i.rows = settings.rows; } else { i.rows =4; } if (settings.cols) { i.cols = settings.cols; } else { i.cols=50; } } else { i = document.createElement('input'); i.type = settings.type; /* https://bugzilla.mozilla.org/show_bug.cgi?id=236791 */ i.setAttribute('autocomplete','off'); } i.name = settings.name; i.id = 'txt'+element_id; i.value=old_content; f.appendChild(i); f.appendChild(document.createElement('br')); if (settings.submit) { var b = document.createElement('input'); b.type = 'submit'; b.value = settings.submit; b.style.backgroundColor='#ff6666'; b.style.color='#ffffff'; f.appendChild(b); } var b = document.createElement('input'); b.type = 'button'; b.id = 'akebutton'; b.value = 'cancel'; b.style.backgroundColor='#dddddd'; b.style.color='#6E6E6E'; b.style.marginLeft='5px'; b.onclick =function(e){ reset(old_content,objtoedit); if (!e) window.event.cancelBubble = true else e.stopPropagation(); } f.appendChild(b); f.onsubmit=function(e) { /* do no submit */ if (!e) window.event.returnValue = false; else e.preventDefault(); /* add edited content and id of edited element to POST */ var p = {}; p[i.name] = $(i).val(); p['id'] = element_id; /* show the saving indicator */ objtoedit = document.getElementById(element_id); objtoedit.innerHTML="Saving....."; $.post(url, p, function(str) { objtoedit.innerHTML=str; }); } objtoedit.appendChild(f); i.focus(); i.onkeydown=function(e){ if (!e) { var e = window.event; e.preventDefault = function() { window.event.returnValue = false } } if (e.keyCode == 27) { e.preventDefault(); reset(old_content,objtoedit); } }; } function reset(oldContent,objtoreset) { objtoreset.innerHTML = oldContent; } its inculded in the file and allready i am using this charecter type in html in mysql in php files ; also i did change charecter groop of akeditable.js file ASI to UTF-8 but mysql updating isnt working when i send query sending type turkish_latin 5 and ISO-8859-9 to falling of absurd chacters. so mysql charecter name is TurkishLatin5_ci but charecters doing like " ÄŸÄŸ" its included in the page allready Pls help me mysql_query("SET CHARACTER SET ISO-8859-9"); mysql_query("SET COLLATION_CONNECTION = 'latin5_turkish_ci'"); header("Content-Type: text/html; charset=ISO-8859-9") Quote Link to comment https://forums.phpfreaks.com/topic/234361-jquery-character-problem/ Share on other sites More sharing options...
karker Posted April 22, 2011 Author Share Posted April 22, 2011 help me plz Quote Link to comment https://forums.phpfreaks.com/topic/234361-jquery-character-problem/#findComment-1204829 Share on other sites More sharing options...
karker Posted April 23, 2011 Author Share Posted April 23, 2011 Downnn Quote Link to comment https://forums.phpfreaks.com/topic/234361-jquery-character-problem/#findComment-1205104 Share on other sites More sharing options...
gizmola Posted April 23, 2011 Share Posted April 23, 2011 karker, UTF-8 is basically compatible with 8859-1. I would suggest that you keep everything UTF-8 across the board, so the problems would most likely be solved by not trying to use 8859-9, and instead store the characters as UTF-8 and use UTF-8 as your charset. Quote Link to comment https://forums.phpfreaks.com/topic/234361-jquery-character-problem/#findComment-1205106 Share on other sites More sharing options...
karker Posted April 23, 2011 Author Share Posted April 23, 2011 But my DB is Full Latin5_Turkish_ci if i use UTF-8 i must change every pages and Db havent u another alternative? Quote Link to comment https://forums.phpfreaks.com/topic/234361-jquery-character-problem/#findComment-1205108 Share on other sites More sharing options...
gizmola Posted April 23, 2011 Share Posted April 23, 2011 Do you have a test url I can look at? Quote Link to comment https://forums.phpfreaks.com/topic/234361-jquery-character-problem/#findComment-1205113 Share on other sites More sharing options...
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.