By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,636 Members | 1,181 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,636 IT Pros & Developers. It's quick & easy.

Encoding problem with ajax

abdoelmasry
100+
P: 104
Hi Men

please help me to solve this problem

i have textbox in html page

i require arabic data from php page using method POST with ajax to view in the textbox

i always got a strange sympols in the textbox

although it works fine when view the recieved data in <div>

is this problem with the textbox

i think there is a way to specify data encoding before post it with ajax

im using this code to post data :

[PHP]xmlhttp.open("post",serverpage,true);
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", datatopost.length);
xmlhttp.setRequestHeader("Connection", "close");[/PHP]
or
should i do some thing to change textbox encoding ?

Greeting
Jul 24 '08 #1
Share this Question
Share on Google+
6 Replies


gits
Expert Mod 5K+
P: 5,343
that seems quite strange ... the characters appear in different ways in an input-element vs. a normal div? do you have a testpage online where this could be reproducable and where we could have a closer look at? ...

kind regards
Jul 25 '08 #2

abdoelmasry
100+
P: 104
Ok Man

Im Writing Script for Photo Shop

I make my script support Ajax To view data without refresh

here is my page :
http://www.egyhk.com/test/order.php

just click on refresh button and look at the customer name textbox

the arabic characters will be changed to strange Sympols
Jul 26 '08 #3

gits
Expert Mod 5K+
P: 5,343
i tested it with firefox ... and besides a problem with the reference to the 'ordiv'-node in the request's (started in line 47 of the script) callback the response itself seems to be correct ... when i refresh the second time the code seems to work fine? what browser do you use? did you check it with different browsers?

kind regards
Jul 26 '08 #4

abdoelmasry
100+
P: 104
Hey man

Im Using Internet explorer 6
Jul 27 '08 #5

gits
Expert Mod 5K+
P: 5,343
could you try it with firefox too please just to be sure that it work correctly ... as i said it seems to with my firefox here ... just the issue with the first reference to the 'ordiv' node? besides that ... why do you refresh the customer name too? wouldn't it be enough to refresh the prices/positions?

kind regards
Jul 27 '08 #6

abdoelmasry
100+
P: 104
Ok Man

i changed requst metho to GET

I Have No problem now

Thank U Prof
Aug 1 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.