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 999997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T07:26:31+00:00 2026-05-16T07:26:31+00:00

I’m trying to use form submit with jquery without a page refresh as demonstrated

  • 0

I’m trying to use form submit with jquery without a page refresh as demonstrated in this tutorial:
submite a form without page refresh using jquery demo

It uses the $.ajax function to post the values, which I’ve included below:

$.ajax({
  type: "POST",
  url: update.php,
  data: dataString, // dataString's value is 'id=5' 
  success: function() { ... };
});

which is working for me in swapping the wrapper that I have around the form…

HOWEVER, when I try to process the dataString in data in update.php (which I’m using to update an entry from a MySQL DB), I get nothing.

in update.php,

I have…

<?php
  require_once('DB.php');
  $dbh = DB:: connect(...);
  if (DB::iserror($dbh)) {
    die(...);
  }
  $aid = isset($_POST['id']);
  // 'id' column datatype is INT
  $sql = "UPDATE [table] SET x = 'blah' WHERE id = ".aid.";";
  $result = $dbh->query($sql);

–regardless, the database doesn’t update. Does anyone see a glaring issue that I don’t (note: I’m new to jquery and AJAX etc altogether) see? I tried using Safari’s developer menu to track what’s wrong, but I can’t figure out how to track the update.php component. Also, I’m not sure how to apply print_r or var_dump to the variables in the update.php page because I’m posting to it separately from the page that’s calling the function in my .js file. Am I approaching this incorrectly? Any assistance would be appreciate–Thanks in advance!

  • 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-05-16T07:26:31+00:00Added an answer on May 16, 2026 at 7:26 am

    Got it… you wouldn’t have been able to see the problem since I didn’t type it here… I’ve had the tendency to add on a ‘$’ to some of my functions lately -_- However, I did come across “curl” which let’s me post to the file directly in the shell environment and see the output that I normally wouldn’t be able to see… that was most useful.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I am trying to understand how to use SyndicationItem to display feed which is
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text

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.