Forum Moderators: open

Message Too Old, No Replies

htmlEntities() & IE

         

Pico_Train

1:50 pm on Jun 11, 2009 (gmt 0)

10+ Year Member



This works fine in Firefox

function addServiceSubmit()
{

var postStr = 'quoteID=' + document.getElementById('quote_id').value;

postStr += '&description=' + document.getElementById('description').value.htmlEntities();

postStr += '&service=' + document.getElementById('service').value;
postStr += '&amount=' + document.getElementById('amount').value;

http.open('POST', '/add-service.php', true);
http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
http.onreadystatechange = requestAddserviceHandler;
http.send(postStr);

}

but in IE it tells me there is an error on line 6 character 2 which is postStr += '&description=' + document.getElementById('description').value.htmlEntities();

I also tried this without any success:

var desc = document.getElementById('description').value;

postStr += desc.htmlEntities();

ANy help would be greatly appreciated.

PS It works fine on my wamp setup but not live.

Fotiman

7:11 pm on Jun 11, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What is it that you think htmlEntities() is? It's not part of JavaScript, HTML, or the DOM...

Pico_Train

8:54 am on Jun 12, 2009 (gmt 0)

10+ Year Member



No no I know, it's a function in an external file I have. I fixed it in the end but not for IE6. IE 6 seems to have problems with

var desc = document.getElementById('description').value;

postStr += '&description=' +htmlEntities(desc);

for some reason. Not sure why and I cant seem to install ie 6 to test so back to window.open...