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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:57:37+00:00 2026-05-29T04:57:37+00:00

I have the following which I use for submitting forms on my site: <a

  • 0

I have the following which I use for submitting forms on my site:

<a onclick="document.forms['REGform'].submit(); return false;" class="button" href="javascript:;">Register</a>

I have inputs within the form with the required tag but this does not seem to fire them? Meaning doesn’t stop empty inputs being submitted.

If I use a normal submit button it works fine by the way – is onclick not a recognised way to submit a form within html5?

  • 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-29T04:57:38+00:00Added an answer on May 29, 2026 at 4:57 am

    The problem is the submit() method, not the use of onclick (although you can’t avoid the former if you want to submit using JS instead of HTML).

    Submitting using JS causes the form’s validation steps to be skipped (although you can re-implement them in JS (with checkValidity()).

    The submit() method, when invoked, must submit the form element from the form element itself, with the scripted-submit flag set.

    — http://www.w3.org/TR/html5/forms.html#dom-form-submit

    If the scripted-submit flag is not set, and the submitter element’s no-validate state is false, then interactively validate the constraints of form and examine the result: if the result is negative (the constraint validation concluded that there were invalid fields and probably informed the user of this) then abort these steps.

    — http://www.w3.org/TR/html5/association-of-controls-and-forms.html#form-submission-algorithm

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

Sidebar

Related Questions

I have the following query which I use to return the highest scores in
I have the following code which I use to match fancybox possible elements: $('a.grouped_elements').each(function(){
I'm trying to use opengl in C#. I have following code which fails with
I have the following in my HTML5 code which makes use of javascript: var
I have the following schema, which I use to ensure that a person's PhoneNumber
I have the following use case , lot of code which was tightly coupled
I have an image uploading script in which i use the following setup to
I am trying to use the following code, which I have not been able
I have a DataTable which is bound to datagridview (Winforms)... I use the following
Can someone help me please. I have the following (simplified) code. function save_all_des(){ document.getElementById(form_zoom1).submit();

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.