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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:10:12+00:00 2026-06-17T23:10:12+00:00

i have several array checkbox, 1 submit button and 1 dropdown menu how can

  • 0

i have several array checkbox, 1 submit button and 1 dropdown menu
how can i disable/enable this submit button and dropdown menu when 1 or many checkbox is checked.
when this submit button is disable and user click on it, dialog box appear tell no checkbox is checked

something like this : http://jsfiddle.net/frantic912/3YbZu/

setButton(buttonGroup) {
    var retArr = new Array();
    if (buttonGroup[0]) {
        for (var i = 0; i < buttonGroup.length; i++) {
            if (buttonGroup[i].checked) {
                document.frm_search.send.disabled = true;
                alert('Please check the first checkbox!');
            }
        }
    }
}


<form  method="post" name="frm_search">
    <table>
        <tr>  
            <td align="center">
                <input type="checkbox" name="appr[]" id="appr" value="<?php echo $row['userID']; ?>" onclick="setButton(this);"/>
            </td>
        </tr>
        <tr>
            <td>bla bla bla</td>
        </tr>
        <tr>
            <td>
                <select name="slct_appr" id="slct_appr" >
                    <option value="1">-- Please Choose --</option>
            <option value="2">Approve</option>
                    <option value="3">None</option>
                </select>
            </td>
      </tr>
      <tr>
          <td align="center">
              <input name="submit" class="submit" id="send" type="submit"  value="send" />
              <input name="txt_action" type="hidden" id="txt_action" value="frm_add_submit" />
          </td>
      </tr>
    </table>
 </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-06-17T23:10:13+00:00Added an answer on June 17, 2026 at 11:10 pm

    As per my understanding you requirement is like this. Please check the DEMO and let me know if its fine to you.

    DESCRIPTION

     $( "input[type=checkbox]" ).on( "click",function(){
        var n = $( "input:checked" ).length;
        if(n > 0){
            $("#send, #slct_lulus").attr("disabled",false)
            return true;
            $("#frm_submit").submit();
        }
        else{
            alert('Please Tick a checkbox!');
            //prevent form submission
            $("#send, #slct_lulus").attr("disabled",true)
    
        }
    });
    

    In above code on every click I am checking the length of check box if its greater than 0 then we are allowing to submit the from else we are not allowing to submit the from and making same time disabled of submit button.

    There is few changes in HTML markup as well like this

    <td><select name="slct_lulus" id="slct_lulus" disabled=true>
                    <option value="1">-- Please Choose --</option>
                    <option value="2">Approve</option>
                    <option value="3">None</option>
                    </select></td>
        <td><input name="submit" id="send" type="submit" disabled=true  value="Send" /></td>
    

    On page load I disabled the select box and button to initial page submit.

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

Sidebar

Related Questions

This is not the explode can solve I have several array $order data: {5,3,2}
I have several checkboxes and a fake submit button to make an AJAX request:
I have several input elements which look like this: <input type=radio checked=checked value=1 name=handle[123]
I have several arrays that are built similar to this: exampleArray=new array( A01 -
I have several array to deal with. I need to extract the most duplicate
I have an object whose value may be one of several array types like
I have a two dimensional JSON array where each element contains several attributes. The
I have a mutable array that is retained and storing several objects. At some
I have an array of checkboxes in a complex dynamic-html form. Whenever a user
I have several input checkboxes, (they name is same for send array on server).

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.