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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:25:34+00:00 2026-05-15T04:25:34+00:00

I have a page like this: <form class=ajax method=post action=add_item.php> [text input] [submit button]

  • 0

I have a page like this:

<form class="ajax" method="post" action="add_item.php">
[text input] [submit button]
</form>

[list any items the user has in a div here called #items]

When the user clicks the submit button, a function like this is called:

$("form.ajax").live('submit', function(event) {
 params = $(this).serialize();
 $.post($(this).attr("action"), params, function(data){
 json = $.parseJSON(data);
 // do stuff based on the json results
  if(json.success.action == 'replace'){
   $(json.success.container).html(json.success.message);
  }
  else{
   $(json.success.container).prepend(json.success.message);
   $(json.success.container).find(".item:first").slideDown();
  }

 });

 event.returnValue = false;
 return false;
});

This is supposed to load add_item.php into the #items div, and it works fine in FF, Chrome, Safari, just not IE. In IE (tested 7 and 8) when I click Submit it redirects the page to add_item.php rather than loading it into the #items div.
I tried adding event.preventDefault(); to the end of the function but that didn’t work.

Any ideas?

  • 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-15T04:25:35+00:00Added an answer on May 15, 2026 at 4:25 am

    Hah!

    Found a fix for it right after I posted that:
    Moved the function to just below $(document).ready and added event.stopPropagation();

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

Sidebar

Related Questions

I have code like so: <form enctype=multipart/form-data method=POST action=blabla.php class=addToCart> <input type=button onclick=addToCartMulti(); value=Add
If i have something like: <form method=post id=customForm action=> //stuff <div id=copiar> <button class=button
I have a page that looks like this: Head and body tags... <form runat=server>
my structure is like this: master page aspx(web form) ascx(user control) I have a
I have a horizontal menu on a page like this <link rel=stylesheet type=text/css href=/classified/siteassets/css/mymenu.css
I have an input control on a page like this: <input type=button causesvalidation=false runat=server
I have a form that looks like this: <form id=addClassesToDoc action=> <table id=classesTable style=border-collapse:
So I have a page like this you look at. On top I have
Say I have a web page like this on an Ubuntu 12.04 web server
I have an Asp .net page like this simple one http://issamsoft.com/app2/page1.aspx and I want

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.