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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:56:27+00:00 2026-06-15T15:56:27+00:00

As below, I am using a ‘Form’ and ‘AJAX’ to post the content of

  • 0

As below, I am using a ‘Form’ and ‘AJAX’ to post the content of a text area to a URL within my site. I see the POST does work and posts the conetn to the server and on success I have tried to find the element on the page to append it, though it is not working.

Can you please advise?. The function success part of the call should be where I specificy the destination, though how do I append this data, put some ajax in the destination page html, on load etc?

<form id="test" onclick="submitForm();">{% csrf_token %}
    <textarea id="red_content" name="content"></textarea>
    <p>
        <input type="submit" value="Publish" name="send">
    </p>
</form>


function submitForm()
{
$.ajax({
url: "http://127.0.0.1:8000/Test/Trial",
data: $('#test'),
type: 'POST',
dataType: 'html',
success: function(data)
{
//$('.content-container5').setFocus();
$('.content-container5').html(data);

}

}); 

Many Thanks,

Tom

  • 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-15T15:56:29+00:00Added an answer on June 15, 2026 at 3:56 pm

    I’m not very familiar with submitting a single field via ajax (or in your case jQuery’s ajax function). I did however have to do a similar function in a project I recently had.

    I found this plugin:

    jQuery Ajax Form Submit

    It seemed to work really well. You may want to look into this for your project as well. In this case, instead of submitting your one field, the form will be submitted. This may be easier since you won’t have to map the fields yourself. You can post the form to the same page and process it or post it to a given url.

    Hope this helps.

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

Sidebar

Related Questions

See the program below: using System; using System.Collections.Generic; using System.Text; using System.IO; namespace FileOperation1
Every time I write a program of the form below using LINQ to SQL,
Sample program below: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace GenericsTest {
How can I call the method below using a http post. Is it necessary
I have class Synonym, below: using System; using System.Collections.Generic; using System.Linq; using System.Text; using
I am trying to dynamically form a nested tree object something like below using
I'm helping a client upgrade his site design, and built the site below using
I have the code below: using (SqlCommand command = new SqlCommand()) { command.CommandType =
How to generate page numbers like the below using javascript/jquery? If the 5 th
How would i create the below using pure CSS (no images, no tables, no

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.