Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

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-07-2010, 01:37 PM   PM User | #1
dj262501
New Coder

 
Join Date: Aug 2010
Posts: 74
Thanks: 12
Thanked 0 Times in 0 Posts
dj262501 is an unknown quantity at this point
Moving info to another page

Hello all,

I need a little help. Right now I have a page that contains code that is designed to send user info to a second page. The code is:

Code:
$(document).ready(function(){
	$('#add').click(function() {
	alert('test');
	});
	$("form#exercise").submit(function() {
	// we want to store the values from the form input box, then send via ajax below
	var activity     = $('#activity').attr('value');
		$.ajax({
			type: "POST",
			url: "newActiveProc.php",
			data: "activity="+ activity +"&func=search",
			success: function(msg){
				$("span#results").html(msg);

			}
		});
	return false;
	});

});
I did not write this code. I inherited it. I was to use something instead of alert (test) to see whether or not the page is working. Why can I put here to add the user's activity to the second page? Any suggestions are appreciated.
dj262501 is offline   Reply With Quote
Old 09-07-2010, 03:21 PM   PM User | #2
Spudhead
Senior Coder

 
Spudhead's Avatar
 
Join Date: Jun 2002
Location: London, UK
Posts: 1,856
Thanks: 8
Thanked 110 Times in 109 Posts
Spudhead is on a distinguished road
This is a little confusing. Just to clarify: you have an element with an ID of "add". When it's clicked, you want the form to submit?
Spudhead is offline   Reply With Quote
Old 09-07-2010, 04:21 PM   PM User | #3
dj262501
New Coder

 
Join Date: Aug 2010
Posts: 74
Thanks: 12
Thanked 0 Times in 0 Posts
dj262501 is an unknown quantity at this point
Quote:
Originally Posted by Spudhead View Post
This is a little confusing. Just to clarify: you have an element with an ID of "add". When it's clicked, you want the form to submit?
I do have an element with an ID of add. When it's clicked, I want the user's selection to be added to a table at the bottom of the page. It would look something like this:

[Add to Activity Log] Sports, Football

When the user clicks the 'Add to Activity Log' button, that activity should be added to a table:

Type Time CalBurned

Football --:-- -----

I hope that helps
dj262501 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 01:59 AM.


Advertisement
Log in to turn off these ads.