replace function doesn't seem to work for IE for a specific value

D

dphizler

Let me explain.

input_name = 'BinaryDisp1';
input_value = 'Eté';

This is my function:
function change_input_value(input_name,input_value)
{
var newstring = input_value.replace('é','\u00E9');
$(input_name).value = newstring;
}

This is to demonstrate that '\u00E9' isn't the problem:
function change_input_value(input_name,input_value)
{
var newstring = 'Et\u00E9';
$(input_name).value = newstring;
}

It's because of the 'é'

When input_value = 'house', the output is hoése, when I ask to replace
'u' with '\u00E9':
var newstring = input_value.replace('u','\u00E9');

Anybody have any ideas how to fix this.

Thanks
 
D

dphizler

Instead of dealing with this in the javascript, I decided to go to the
root of the problem and use the utf8_encode function in php to fix
this.

Trust in the php.

Thanks anyways,
Phil
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,189
Latest member
CryptoTaxSoftware

Latest Threads

Top