Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Textarea Javascript Problems

    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 ^___^

    Code:
    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.

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Quote Originally Posted by loversama View Post
    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?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Sep 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    jQuery, as I forgot to mention ^___^

    I am also aware that:

    Code:
    $('#notes').val(response.notes).val('value', response.notes);
    Should read:

    Code:
    $('#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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •