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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:16:13+00:00 2026-06-14T21:16:13+00:00

I have a div and into this I have 2 checkboxes and 2 inputs

  • 0

I have a div and into this I have 2 checkboxes and 2 inputs text but I want validate or check if all inputs are empty to display an alert or error and that fill at least one input (checkbox or text) because I don’t do two validations: 1 for checkboxes and 2 for inputs text… exists any way to do this?

HTML

<div id="t_disp">
    <p>
        <label for="7x24">7x24</label>
        <input id="7x24" name="7x24" type="checkbox"/>
    </p>
    <p>
        <label for="5x8">5x8</label>
        <input id="5x8" name="5x8" type="checkbox"/>
    </p>
    <p>
        <label for="especial">Especial</label>
        <input id="especial" name="especial" type="text"/>
    </p>
    <p>
        <label for="ticket">Ticket</label>
        <input id="ticket" name="ticket" type="text"/>
    </p>
</div>

Thanks in advance!!

  • 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-14T21:16:14+00:00Added an answer on June 14, 2026 at 9:16 pm

    To get how many inputs are filled/checked:

    var filled = $('#t_disp input').filter(function() { 
      return $(this).is('[type=checkbox]') ? this.checked : this.value;
    }).length;
    
    if ( filled ) {
       // at least one input is filled
    } else {
       // all inputs are empty
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am loading some text dynamically into a div, but have the problem that
Ok. I have an editable div into which I can enter some text. However
Suppose I have div and I want to fetch data and push data into
I have a javascript that displays a generated text into a div: document.getElementById('phrase').innerHTML =
I have it working... Kind of. The content loads into the DIV but it
I have code of Jquery login control loke following using this into asp.net but
I have many checkboxes having text as substring from a long message. This I
I have some checkboxes with related fields that are marked up like this: <div
I have a bunch of html check boxes on a page, but want to
I have a little issue concerning an animation-effect which loads a certain div into

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.