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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Find out what you should include to make the best professional email signature for your organization.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

628 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