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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T13:15:08+00:00 2026-06-09T13:15:08+00:00

my code is as following: form.submit();//synchronized submit, not asynchronous,the form is not a html

  • 0

my code is as following:

form.submit();//synchronized submit, not asynchronous,the form is not a html form but created by javascript
some codes here;//Is this line executed, or it sometimes executed sometimes not

I have some statistics code(send a http request to a server) in 2rd line and really get some data. Because there is a big gap between the statistic data and expected, I doubt 2rd line is always executed.

  • 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-09T13:15:09+00:00Added an answer on June 9, 2026 at 1:15 pm

    It depends on what the form does on submit:

    • If the form submits normally, then the code may run. Normal form submission redirects the browser to the url defined in the action attribute. The code may run but the page is already preparing to leave thus you may not see what the code after form.submit() does.

    • If the form submits and is caught by JavaScript (maybe by an event handler), then the code after form.submit() could run but depends on what that event handler does. If the handler does not prevent normal form submission, then the situation is the same as the first. If the handler prevents normal form submission, then it can run.

    I suggest you build a handler for that form that prevents normal form submission using techniques like return false and/or event.preventDefault() and also, run the code in there as well.

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

Sidebar

Related Questions

I have the following code: echo ' <td> <input type=button name=delete value=X onclick=clearSelection(this.form, '.$type.');this.form.submit();
The following code should update a hidden field on form submit but it simply
i'm using the following code to submit a form: function submitfilter(){ alert(in here); var
I am using the following code: $(.searchBtn).closest('form').submit(function () { $(this).find('.showComments tr:last').after(<tr><td>TEST</td></tr>); }); and I
The following code is used to validate when form submit button is hit, but
Can anyone tell me why the following code fails to submit the form into
i have the following block of code: $(#contact_container form, #contact_details form).live( submit, function(event) {
In the following code snippet: <form> <fieldset> <button id=indexGetStarted class=button type=submit>Get Started!</button> </fieldset> </form>
I have the following code on a view: @using (Html.BeginForm()) { <div class=select-box form>
The following code is working fine in other browsers, but is not on IE8

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.