Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-18-2011, 01:02 PM   PM User | #1
tomharto
Regular Coder

 
Join Date: Jul 2010
Location: Sheffield
Posts: 795
Thanks: 91
Thanked 18 Times in 18 Posts
tomharto is on a distinguished road
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..
tomharto is offline   Reply With Quote
Old 09-18-2011, 02:16 PM   PM User | #2
tomharto
Regular Coder

 
Join Date: Jul 2010
Location: Sheffield
Posts: 795
Thanks: 91
Thanked 18 Times in 18 Posts
tomharto is on a distinguished road
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);
							}
						});
					});
tomharto is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:53 AM.


Advertisement
Log in to turn off these ads.