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

The Archive Base Latest Questions

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

I have a page with a form and navigation links. If you click on

  • 0

I have a page with a form and navigation links. If you click on a navigation link I need to submit the form as well as follow the navigation request.

To do this I have a link who’s href is pointing to the new page request and I have the onclick event bound to a function that submits the form on the page.

Could this scenario cause hard to reproduce problems of the form not submitting?

ex:

function submitForm(){
document.myform.submit();
}

<a href="page1.html" onclick="submitForm()">Back To page 1</a>
<form action="procsub" method="post"><input type="text" id="val1" /></form>
  • 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-13T00:40:05+00:00Added an answer on May 13, 2026 at 12:40 am

    Submitting a form basically means reloading the page (targeting the same page, or a different one, as defined in the form). following a link is also a means of reloading the page.

    what you could do would be to modify your submitForm function like so:

    function submitForm(a) {
        document.myform.action += '?redirectPage=' + a.href; // given that action doesn't already contain querystrings
        document.myform.submit();
    }
    

    and

    <a href="page1.html" onclick="submitForm(this);">Back to page 1</a>
    

    And then have the page that handles the form request, do the postback to whichever page was being passed as redirectPage.

    A form submit is really not what the user expects when clicking ‘back to page 1’ tho. you may want to think this through one more time…

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

Sidebar

Related Questions

I have a php page called form.php. When you go to this page it
I have a side navigation bar and when you click the links it submits
I have a webpage and if I click a link in the page, it
I have three leaves in my navigation bar on this page . Each leaf
I have this page which loads quotes. It has a search form wherein if
I have xhtml page with simple form. This page is using for several data
I have a multi-page form, aka a Wizard pattern, where Page 1 corresponds to
I have a form page in PHP that reads a DBF, and conditionally converts
I have a page with a form that is submittes via ajaxSubmit() (so, without
I have a page with a form on it that needs to post to

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.