Jump to content

Recommended Posts

hi freinds,

 

i edit some following codes. it is copying from studentName textfield and writing to studentLink textfield, This ok but,

it can not converting in studentName special characters to studentLink textfield. How can it write to studentLink textfield without special characters ?

 

 

 

<script>
function sync()
{
  var n1 = document.getElementById('studentName');
  var n2 = document.getElementById('studentLink');
  n2.value = n1.value;
}
</script>
<script language="JavaScript">
function karaktercevir(text)
    {
      var yaz = new String();
      var chars = text.value.split("");
      for (i = 0; i < chars.length; i++) {
          chars[i]=chars[i].replace("Ç", "C");
          chars[i]=chars[i].replace("ç", "c");
          chars[i]=chars[i].replace("Ğ", "G");
          chars[i]=chars[i].replace("ğ", "g");
          chars[i]=chars[i].replace("İ", "I");
          chars[i]=chars[i].replace("ı", "i");
          chars[i]=chars[i].replace("Ö", "O");
          chars[i]=chars[i].replace("ö", "o");
          chars[i]=chars[i].replace("Ş", "S");
          chars[i]=chars[i].replace("ş", "s");
          chars[i]=chars[i].replace("Ü", "U");
          chars[i]=chars[i].replace("ü", "u");
          yaz += chars[i];
      }
      if (text.value != yaz) text.value = yaz;
    }
</script>  
Edited by dgnzcn
Link to comment
https://forums.phpfreaks.com/topic/281274-special-characters-converting-problem/
Share on other sites

 

it can not converting in studentName special characters to studentLink textfield

 

Do you have a meta tag with charset utf8 on the top of the page, something like:

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

 

Do you have a meta tag with charset utf8 on the top of the page, something like:

 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

hi

 why not converting?

 

yes it has <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

Some browsers do not always correctly set the charset HTTP header, so I think you could try adding a header("Content-Type: text/html; charset=utf-8"); in your PHP file if you are using one.

 

Otherwise, try getting the Unicode-formatted character encodings for the characters you need.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.