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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:38:00+00:00 2026-05-19T00:38:00+00:00

I have this form: <form id=basicTerms method=post onsubmit=return validateForm()> and the function in the

  • 0

I have this form:

<form id="basicTerms" method="post" onsubmit="return validateForm()">

and the function in the onsubmit is below:

function validateForm()
{
    return false;
}

I’ve done this to test the form, and when I click Enter or click on a button on the form that performs triggers the form submit action, the form submits and moves to the next page.

I also have these buttons in the form:

<tr>
    <td align="left"><button style="background-color:#FF80FF" onclick="javascript:document.getElementById('basicTerms').action='helpFile1.php'; document.getElementById('basicTerms').submit()" tabindex="6">Go Back</button></td>
    <td align="center"><button style="background-color:#FFC080" onclick="javascript:document.getElementById('basicTerms').action='helpFile2.php'; document.getElementById('basicTerms').submit()" tabindex="4">Lets Go To Step 2</button></td5>
    <td align="right"><button style="background-color:#00FF00" onclick="printThis()" tabindex="5">Print</button></td>
</tr>

I want to know why the forms submits even when I return a false in onsubmit.

I’ve tested the form on Google Chrome and FireFox, both gave the same result. Also, I’m testing on localhost WAMP: Apache2.2.11, PHP5.3.0.

  • 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-19T00:38:01+00:00Added an answer on May 19, 2026 at 12:38 am

    Try adding type="button" to your button tags. Otherwise I believe they default to submit buttons.

    (added as an answer since it worked as a solution)

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

Sidebar

Related Questions

I have this form: <form action=javascript:; class=iceFrm enctype=application/x-www-form-urlencoded id=frmMainMenu method=post onsubmit=return false;> ..... </form>
i have this form: <form id=myform name=myform action=test.php method=post> <input type=text name=shout-in id=proShoutIn maxlength=80
I have this form: <form name=input action=http://s164074194.onlinehome.us/mail.py method=POST> Username: <input type=text name=email /> <input
I have this form: <form action= method=post> <label for=color>Color:</label> <input type=text style=width: 195px; name=color
I have this form submit code: Event.observe(window, 'load', init, false); function init() { Event.observe('addressForm',
I have this form: <form method=post enctype=multipart/form-data accept-charset=UTF-8> But when I submit an é
I have this form in my HTML: <form action=/awe/ChangeTheme/Change method=post> <select id=themes name=themes> ...
I have this form: <form method=post action=mypage.php orderform= name= id=orderform> <a id=add>+</a> <table width=533
I have this form in HTML: <form action=# method=post> <label for=label-id>id</label> <input type=text name=id
I have this form : <form action=index.php?explore=browse method=post> <input type=hidden name=artist value=<?=$artist?> /> <input

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.