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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:59:59+00:00 2026-05-26T06:59:59+00:00

i have problems with ajax requests and simple <input type=submit/> . i use to

  • 0

i have problems with ajax requests and simple <input type="submit"/>.

i use to load views inside other views, modular i mean, with jquery using .load(url) from one view to another.
so the problem is that if i load view_2 inside view_1 and the js script for view_2 is inside view_1 i need to use live('click') for example to launch an xhr request from view_2, so when i try it launches 3 (multiple) xhr at same time, instead of only 1 at time, don’t know why.

the only thing i know is:

  1. using live('click') in view_1 it launches 3 multiple XHR.
  2. using click() in view_1 it doesn’t work(obviously i think).
  3. using click() directly inside view_2 it works (but i can’t use js
    in loaded views, i can use js only in “parents” views)

the functions are really simple, really don’t know why i have this problem (i also disabled submit in ajax beforeSend) check this is a view_1 code which runs on loaded view_2 and launches 3 XHR for click 😐

$(document).ready(function(){ 
   $('#save-doc').live('click',function(){
    var _title = $('#doc-title').val();
    var _doc = $('#doc-doc').val();
    update_doc(url_update_doc,{'title':_title,'doc':_doc,'id_doc':_choosed_doc,'id_project':id_project},this);
    });
});
function update_doc(_url,_data,_starter){
    $.ajax({
        type:'POST',
        data:_data,
        url:_url,
        dataType:'json',
        beforeSend:function(){
            $('.ajax-loading').show();
            $(_starter).attr('disabled','disabled');
        },
        error:function(){
            $('.ajax-loading').hide();
            $(_starter).removeAttr('disabled');
        },
        success:function(json){
            $('.ajax-loading').hide();
            $(_starter).removeAttr('disabled');
            if(json.error){
                $('#error-title').html(json.error_title);
                $('#error-doc').html(json.error_doc);
                $.scrollTo('.append-form-edit-doc','fast');
            }
            if(json.confirm){
               $.scrollTo('#top','fast');
               $.gritter.add({
                   title:'Document Saved',
                   text:json.confirm
               });
           }
        }
    });
}
  • 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-26T07:00:00+00:00Added an answer on May 26, 2026 at 7:00 am

    If that’s a submit button inside the form then unless you prevent the default action, the form will be submitted. (That’d account for 2 POSTs, but not three.)

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

Sidebar

Related Questions

Imagine this simple form for uploading a file: <form action=upload enctype=multipart/form-data> <input type=text name=name/>
I'm making an ajax request and I have some problems, this is my jquery
I have a simple view that I want to respond to both ajax and
Hey guys, I have a little problem with a simple ajax request. I can't
I have a simple comet chat. JavaScript send ajax request with long polling. When
I have a simple ajax call: $.ajax({url: my_url_here, dataType: 'text', success: function(data, textStatus) {
I have form where before i was using simple post with <button name=submit id=register
I have a simple load more style script that works fine on the index
I have a simple AJAX request which sends data to a PHP and the
I have a problem in giving Ajax functionality to a hyperlink. I have files

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.