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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T11:43:40+00:00 2026-05-13T11:43:40+00:00

Using jQuery 1.4 to do this. Adding a form to the body tag, nothing

  • 0

Using jQuery 1.4 to do this.

Adding a form to the body tag, nothing special about the form itself:

$(function() {
$('body').prepend('<form name="frmSample" id="frmSample"><input class="btn" type="submit" value="SIGN UP" /></form>');
});

I’m using the following to submit the form:

$('#frmSample').live('submit', function() {
  var formdata = $(this).serialize();

   $.ajax({
       type: 'POST',
       url: 'http://www.example.com/Values.jsp',
       data: formdata,
       success:function() {
       submit_success();
       }
       });
  return false
  });

On the newest browsers (Firefox 3.5, Safari 4) this works fine. Once I go down to FF 3.0 and below or IE 7 and below this stops.

I’m a bit stuck right now. I’ve been searching for a good bit and have only been able to find anything mentioning something other than return false or event.preventDefault().

So looking to see if I am missing something small here, or am going in the totally wrong direction.

  • 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-13T11:43:41+00:00Added an answer on May 13, 2026 at 11:43 am

    I would go a step further than stopPopagation:

    $('#frmSample').live('submit', function(e) {  
        stopEvent(e);  
        ....etc...etc
    

    And the code for stopEvent:

    function stopEvent(event) {
        event.preventDefault();
        event.stopPropagation();
        if ($.browser.msie) {
            event.originalEvent.keyCode = 0;
            event.originalEvent.cancelBubble = true;
            event.originalEvent.returnValue = false;
        }
    }
    

    From here: http://www.openjs.com/articles/prevent_default_action/

    returnValue and preventDefault() methods

    That does what we need – but we cannot rely on the return false method for preventing the default action. Giving this code will exit the function – so if there is more to do in the function, this code cannot be used. In most of the situations I encounter, return false is enough, but in some areas, we need something more drastic.

    Type the following into google for more info:

    preventDefault stopPropagation
    cancelBubble

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

Sidebar

Related Questions

Using this jquery code: <a href=javascript:void(0) id=m1>Get Selected id's</a> jQuery(#m1).click( function() { var s;
I'm using this: jQuery('.class1 a').click( function() { if ($(.class2).is(:hidden)) { $(.class2).slideDown(slow); } else {
I'm using the jQuery validate plugin. I have this code: $(.btn-overview-basic-save).click(function(e) { if (!$('.contact-overview').valid())
I'm using JQuery for this. The problem is that, when I drag an object
[edit] I am NOT using jquery in this app. Looking for a way to
I am trying to make two ajax requests in parallel using jQuery like this:
how can we save dragged item with cookies. I'm using Jquery with this code
I'm using this JQuery autocomplete plugin http://www.devbridge.com/projects/autocomplete/jquery/ in my project. I followed this tutorial
I'm using this jquery plugin to build forms. In order to allow the modification
I am using this JQuery Ajax Voting system guide as a rough reference but

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.