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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:29:56+00:00 2026-06-13T18:29:56+00:00

I have Some text boxes and one submit button. I have Used HTML5 ‘required’

  • 0

I have Some text boxes and one submit button. I have Used HTML5 ‘required’ validation. Its working fine. Now I want to call a function in button click when HTML5 validation does not find any Error. When The required field is not provided the button click will not call the function.

  • 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-13T18:29:58+00:00Added an answer on June 13, 2026 at 6:29 pm

    You’re going to need some extra help to do this, it could be in the form of plain javascript. Personally, I’d use jQuery to help out as it will make things easier for you and account for any cross-browser consistencies. Whether or not you want to use jQuery your is choice, whether it’s appropriate only for this is another conversation, the following example is just a demonstration.

    Here’s a hypothetical example using jQuery that achieves your validation listening functionality:

    HTML

    <form>
        <input type="text" class="input-text" required>
        <input type="text" class="input-text" required>
        <input type="submit" id="submit" class="input-button" disabled>
    </form>
    

    ​
    JS

    $textInputs = $('input.input-text');
    $textInputs.on('keyup', function() {
        var $validTextInputs = $('input.input-text:valid'),
            $submit = $('#submit');
        console.log($textInputs.length, $validTextInputs.length);
        if($textInputs.length === $validTextInputs.length){
            //all text fields are valid
            $submit.attr('disabled', null);
        } else {
            //not all text fields are valid
            $submit.attr('disabled', '');
        }
    });​
    

    CSS (only let’s us know, visually, when the input is valid)

    .input-text:valid {
        background: green;
    }​
    

    See the example in action here: http://jsfiddle.net/m6QXc/

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

Sidebar

Related Questions

I have two text boxes and one button. I want when i will type
Pretty simple question. I have a few ASP RequiredFieldValdators checking some text boxes. Out
Using ASP.NET VB, I have a form with some text boxes and a Gridview.
I have some text boxes, all of which have the same class addExamNumberBoxStyle. Now
I use VS2010,C# to develop ASP.NET web app, I have some two text boxes,
I have a some text boxes in my form. I don't know their id
Let's say I have a form with some text boxes and combo boxes on
I have a form containing some dynamic elements. These are basically text input boxes
Using MVC3 Razor, I have a partial view with some text, two text boxes
I have a form in which i have some text boxes and below 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.