Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8411845
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:31:41+00:00 2026-06-10T00:31:41+00:00

I am having some trouble posting data through AJAX. I created a small save

  • 0

I am having some trouble posting data through AJAX. I created a small save script which determines in which table a POST must be saved (I am using a different form for each table):

$(function() 
{
    $( "#tabs" ).tabs().find( ".ui-tabs-nav" ).sortable({ axis: "x" });
});

function save(target)
{
    switch(target)
    {
        case "praktijk":
            $.ajax({                                                                                                           url: 'webscripts/admin/opslaan.php?type=praktijk',
                type: 'POST',
                data: $("#tabs-2").find('form').serialize(),
                success: function(){
                    alert("gegevens opgeslagen!");
                    $('#popup').dialog('close');
                }
            });
            break;
        case "persoonlijk":
            $.ajax({                                                                                   
                url: 'webscripts/admin/opslaan.php?type=persoonlijk',
                type: 'POST',
                data: $("#tabs-1").find('form').serialize(),
                success: function(){
                    alert("gegevens opgeslagen!");
                    $('#popup').dialog('close');
            }
        });
        break;
    case "vragen":
        $.ajax({
            url: 'webscripts/admin/opslaan.php?type=vragen',
            type: 'POST',
            data: $('#tabs-3').find('form').serialize(),
            success: function(){
                    alert("gegevens opgeslagen!");
                    $('#popup').dialog('close');
            }
        });
        break;
}

}

as you can see, I next determine it for the PHP script by using a GET variable that says which table it needs to save it in. But this doesn’t work. The script appears to be crashing at this point. I am not sure where exactly it crashes.. the Firebug terminal doesn’t show any obvious errors.

Does somebody know why it doesn’t work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:31:42+00:00Added an answer on June 10, 2026 at 12:31 am

    First of all, if you’re using a different form for each table, why not send the right table name (‘persoonlijk’, ‘vragen’, etc.) with the form itself?

    example:

    <form ...>
    <input type="hidden" name="target" value="persoonlijk" />
    ...
    </form>
    

    And in php:

    <?php
    if($_POST['target'] == 'persoonlijk') {
        // save in table 'persoonlijk'
    } else {
       // save it somewhere else
    }
    ?>
    

    Furthermore, reading out a php var can not break your javascript, simply because you are working on the server, and javascript works in the browser. Please print out the get en post vars using print_r($_GET);, then explain what ‘seems to break’ means (what happens, what do you see (error messages and such)).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having trouble posting json to a little node.js http server. Post data always
I'm having some trouble POSTing data from a client machine to our internal site
Having some trouble sending properly formatted HTML e-mail from a PHP script. I am
I having some trouble figuring this problem out where I have one button which
I'm trying to post some form data and return results but I am having
I am having trouble with some Ajax functionality. I have a single dropdown that
having some trouble creating a trigger across databases. I am doing this query through
Having some trouble overriding ActionBarSherlock styles, hopefully someone can help. I have created a
I am porting some C# code over to Java. I am having trouble with
Having some trouble with R's garbage collection, when passing objects to C++. We have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.