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

  • Home
  • SEARCH
  • 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 8153523
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T16:02:45+00:00 2026-06-06T16:02:45+00:00

I am trying to run this tutorial i did not implement the validation part

  • 0

I am trying to run this tutorial

i did not implement the validation part yet, but my problem shouldn’t be based on this. Here is my code:

<script type="text/javascript">
$("#submitbutton").click(function () {
  var content = $.("#contentarea").val();
  $.ajax({
    type: "POST",
    url: "addArticle.php",
    data: content,
    success: $.("#addArticle").append("<p>ok</p>")
  });
  return false;
})
</script>

As seen in the demo, it should not refresh the page because of the return false statement and also should do a post instead of get. But neither it does. It will continue to reload the page and also append the given content to the url as an argument. How do i prevent this / where is my failure?

Here is the whole thing

  • 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-06T16:02:46+00:00Added an answer on June 6, 2026 at 4:02 pm

    The tutorial you have followed is incorrect. There are more ways to submit a form than just clicking on its submit button (for example, you can press return while in a text field). You need to bind your code to the form’s submit() event instead of the button’s click() event.

    Once you have done this, use your in-browser debugger to check whether the code is actually being run when you submit the form.

    Also, the success parameter needs to be a function:

    submit: function() { $("#addArticle").append("<p>ok</p>") } 
    

    EDIT : also, you have written $.( instead of $( several times. This will cause a runtime error, which may cause the code that blocks the submission to fail.

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

Sidebar

Related Questions

Hi I am trying to run this query in SQL but it is not
I'm trying to run this code but this error appear: Uncaught TypeError: string is
I'm trying to follow this tutorial but with the immediate window in vs2010 rather
I am trying to run a Rails app on thin. I followed this tutorial
I am trying to get my head around NHibernate, I've run through this tutorial
When trying to run this zest tutorial, I get the following error: The type
I may have multiple questions here, but ultimately I'm trying to compile and run
Based on http://tutorialzine.com/2011/06/beautiful-portfolio-html5-jquery/ tutorial I am trying to implement a sort function to my
I am trying out this example http://thinkdiff.net/facebook/new-javascript-sdk-oauth-2-0-based-fbconnect-tutorial/ But I am getting xml error which
I'm trying to setup Guard using this tutorial, however when I run bundle exec

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.