Disabling the Forms Submit button until a checkbox is selected

Posted on 2011-02-15
Last Modified: 2012-05-11
Has anyone got a URL or a piece of JS code handy that can ensures a Form Submit button stays disabled until a checkbox is ticked?
Question by:kiwistag
LVL 20

Accepted Solution

chaitu chaitu earned 125 total points
ID: 34895462
 function ex(obj)
<input type='checkbox' id='check' onclick='ex(this)'>
<input type=submit id=submit  value='submit ' disabled >
LVL 20

Expert Comment

ID: 34895529

Here's another example for you:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<script src="" language="javascript"></script>
<script language="JavaScript">

$(function() {

  $("#enable").click( validate );
  $("#process").attr( { disabled: true } );


function validate() {
  $("#process").attr( { disabled: !this.checked } );



<input id="enable" type="checkbox" />
<input id="process" type="button" value="Submit" /> 


Open in new window


Author Closing Comment

ID: 34895543
Was only missing <script> at the top but worked a dream - thanks :)

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now