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 2 of 2
  1. #1
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    824
    Thanks
    93
    Thanked 18 Times in 18 Posts

    Textbox value is being strange (Value then undefined)

    If i run this section of my code
    Code:
    alert($("#issueBox").val());
    $("#mainBody").html("Loading…");
    var Link = $(this).attr("href");
    var Issue = $("#issueBox").val();
    var Rel = $(this).attr("rel");
    alert(Issue);
    The first alert box displays the correct value yet the second one displays undefined. It will be some stupid simple thing i cant see but i can anyone else tell why its being weird?
    Last edited by tomharto; 09-18-2011 at 01:35 PM.

  • #2
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    824
    Thanks
    93
    Thanked 18 Times in 18 Posts
    EDIT: Found it, the textarea was inside mainBody and that was getting replaced by the Loading message.

    Change it to this and it worked

    Code:
     $(".replyer").click(function(event){
    						event.preventDefault();						
    						var Link = $(this).attr("href");
    						var Issue = $("#issueBox").val();
    						var Rel = $(this).attr("rel");
    						$("#mainBody").html("Loading…");
    						$.ajax({
    		    				type: "POST",
    			   				url: "pages/"+Link,
    		    				data: Rel+"&issue="+Issue,
    		    				success: function(msg){
    								$("#mainBody").html(msg);
    							}
    						});
    					});


  •  

    Posting Permissions

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