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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:56:18+00:00 2026-05-28T02:56:18+00:00

I have this jquery post that takes text from a textarea and inputs it

  • 0

I have this jquery post that takes text from a textarea and inputs it into a mysql database and then changes a div value. This is all done when a button is clicked. The jquery function is:

 $('#editAnswerSubmit').click(function(e){  //the button 
    e.preventDefault();

        var edited_answer = $('#modalEditAnswer').val();

        $.post('../submiteditanswer.php' , {edited_answer: edited_answer , answer_id: answer_id} , function(response){

                answer.val(response);
                $('#editAnswerModal').modal('hide');
        });
});

I have alert() all of the variables when the button was clicked and the correct values appeared so there must be something wrong with the post code itself. I also had an alert('test') after the post but before the first response and it never appeared.

Contents of submiteditanswer.php:

<?php
include 'connect.php';
$answerID=$_POST['answer_id'];
$sql=mysql_query("UPDATE answers SET time='2' WHERE id='$answerID'");
$edited_answer=mysql_real_escape_string($_POST['edited_answer']);
$time=time();

$sql=mysql_query("UPDATE answers SET time='$time' , answer='$edited_answer' WHERE id='$answerID'");
echo $edited_answer;
?> 
  • 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-28T02:56:18+00:00Added an answer on May 28, 2026 at 2:56 am

    chances are jQuery cannot find submiteditanswer.php

    The path should be relative to /

    Have a look in firebug, chrome developer console, or fiddler and i’m pretty sure there will be some 404 errors in there.

    If you need help working out which path to use, let us all know where submiteditanswer.php sits in your directory structure.

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

Sidebar

Related Questions

I have some jQuery that takes the value of a text input and puts
I have this code that takes info from a form and sends it to
I have some jquery that takes the value of a textbox, inserts it into
I have this jQuery code that queries an API on a keyup event (via
I have this jQuery datepicker code that initially set the minDate of the datepicker.
I have this code in jQuery, that I want to reimplement with the prototype
I have this code in jquery : $(#order_btn).click(function(){ var totalprice = $(.price_amount).text(); $(#totalprice).val(totalprice); });
I have this jQuery which works fine $(li[id^='shop_id']).click( function () { alert(I clicked on
I have this jQuery: $(document).ready(function() { $(#panel).hide(); $('.login').toggle( function() { $('#panel').animate({ height: 150, padding:20px
I have this jquery script which suppose to hide/show div element base on the

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.