...

View Full Version : Moving info to another page



dj262501
09-07-2010, 02:37 PM
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:



$(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.

Spudhead
09-07-2010, 04:21 PM
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?

dj262501
09-07-2010, 05:21 PM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum