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 to the CF scene
    Join Date
    Nov 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Jquery refersh table

    Please look at this example page
    http://www.brightcherry.co.uk/code_e...esh/insert.php

    Basicly I have a page with database results, there is an edit button when clicked, pops up a Greybox Redux with a form in it to edit the database results

    When the form is submitted I want to update the records that are in the main <div> without a page refresh.

    Using the above example imagine the form portion in a greybox and when submitted it closes the greybox, proccess the form, gets the results and updates the div on the main page. I dont want to refresh the whole page just the contents in the '#showdiv'

    I am using the method above I just dont know how to modify the javascript to target the div on the main page. If works fine if I place the div and the form on the same page. Do I just modify the target below? to point to the parent page and the div id?

    Code:
    <script type="text/javascript">
      $(document).ready(function() {
        $('#myForm').ajaxForm({
          target: '#showdata',
          success: function() {
            $('#showdata').fadeIn('slow');
          }
        });
      });
      </script>
    Last edited by mrmrsg; 11-10-2010 at 08:48 PM. Reason: addtional info

  • #2
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    Is this what your going for?
    Code:
    <script type="text/javascript">
      $(document).ready(function() {
    
        $('#myForm').submit({
    $.ajax({
      type: 'POST',
      url: 'data.php',
      data: $("#myForm").serialize(),
      success: function() {
            $('#showdata').load("data.php").fadeIn('slow');
          }});
      });
       });  </script>

  • #3
    New Coder
    Join Date
    Dec 2010
    Posts
    50
    Thanks
    6
    Thanked 0 Times in 0 Posts
    can someone explain how this was done http://www.brightcherry.co.uk/code_e...esh/insert.php

    i want to do something very similar but i dont know where to start. anyone know where i can find a premade script for this?


  •  

    Posting Permissions

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