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 Coder
    Join Date
    Aug 2010
    Posts
    74
    Thanks
    12
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    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?

  • #3
    New Coder
    Join Date
    Aug 2010
    Posts
    74
    Thanks
    12
    Thanked 0 Times in 0 Posts
    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


  •  

    Posting Permissions

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