...

View Full Version : Textarea Javascript Problems



loversama
09-29-2011, 08:34 AM
First of all thank you for taking the time to read my post.

The problem I am experiencing is 'notes' is being pulled from the database and the value is being displayed in a textarea, however if the information that is being pulled contains a Symbol, like = or for example the textarea becomes blank, I am not very good with Javascript so someones help/advide would be a god send ^___^


var Popup = {
loadEnquiry : function (enquiry_code){
$.post(
Page.ajaxUrl,
{ToDo : 'Get_Enquiry', 'enquiry_code' : enquiry_code},
function (response){
if(response.success > 0){
$('#enquiry_code').val(response.enquiry_code).attr('value', response.enquiry_code);
$('#customer_name').val(response.customer_name).attr('value', response.customer_name);
$('#telephone').val(response.telephone).attr('value', response.telephone);
$('#turbo_part_number').val(response.turbo_part_number).attr('value', response.turbo_part_number);
$('#notes').val(response.notes).val('value', response.notes);
$('#company_id').val(response.company_id).attr('value', response.company_id);
}else if(response.error > 0){
alert("Something went wrong.");
}else{
alert("Invalid server response!");
}
}, 'json'
);
}
};

If anything else is needed please let me know, Thanks in Advanced.

Kor
09-29-2011, 11:25 AM
I am not very good with Javascript
Obviously. Otherwise you should have sensed that the code uses a custom syntax of a JavaScript library, probably JQuery, but one never can be sure, because there are many javascript libraries in use (JQuery, MooTools, Prototype, Google API, Yahoo API, etc, each one with a custom syntax which is not understandable without knowing which is which). So, if you use a library, be so kind and tell us: which one is?

loversama
09-29-2011, 01:02 PM
jQuery, as I forgot to mention ^___^

I am also aware that:


$('#notes').val(response.notes).val('value', response.notes);

Should read:


$('#notes').val(response.notes).attr('value', response.notes);

it was a mistype, but my issue is still the same, I am at the understanding that I may need to use htmlentities.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum