Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New Coder
    Join Date
    Jan 2011
    Thanked 7 Times in 7 Posts

    Posting to a PHP page then having the current page update

    I posted in the PHP forum about this and I'm starting to think (after other pointed out) that my PHP codes may not be the culprit here.. If someone could shed the light on what I'm doing wrong it would be greatly appreciated..

    Thanks in Advance!!

    Here's what I'm trying to do:

    on (page1.php) submit a form that has 3 variables that the user inputs - these var's are sent to a seperate processing page (process.php) - but on Page 1 there is a current list of things the user already added and when they add another item I want it added to the very last line..

    Ideally, this is what I'm wanting to do: http://demo.tutorialzine.com/2010/03...l-css/demo.php

    However, I want to be able to add the values before it's added, be able to edit each variable (per id (IE: Name, Number, Description) - not just 1 object all together) and I don't want the "repositioning" feature that this has.

    Here's my JS

    $(function() {  
      $(".button").click(function() {  
        // validate and process form here  
          var p_name = $("input#p_name").val();  
            if (p_name == "") {  
          return false;  
            var p_desc = $("input#p_desc").val();  
            if (p_desc == "") {  
          return false;  
            var p_numb = $("input#p_numb").val();  
            if (p_numb == "") {  
          return false;  
      var p_name = $("input#p_name").val();  
      var p_desc = $("input#p_desc").val();  
      var p_numb = $("input#p_numb").val();
      //submit the form here
      var dataString=new Array(p_numb, p_name, p_desc)
    //var dataString = 'p_name='+ p_name + '&p_desc=' + p_desc + '&p_numb=' + p_numb;  
    //alert (dataString);return false;  
      type: "POST",  
      url: "addPort.php",  
      data: dataString,  
      success: function() {  
        $('#contact_form').html("<div id='message'></div>");  
    return false;
    Here's a link to my PHP Post (which has more coding listed) http://www.codingforums.com/showthread.php?t=216996
    Last edited by RoMa; 02-01-2011 at 04:21 AM.


Posting Permissions

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