Welcome visitor
* Login
* Register
It is currently March 25th, 2019, 2:12 pm
All times are UTC [ DST ]
* Search
View unanswered posts - View active topics

FORUMS » Client Side » HTML



Post new topic Reply to topic  [ 2 posts ] 
Author Message
  able and disable a submit button
PostPosted: July 7th, 2009, 8:28 pm 

Posts: 46
hi, i have a form with its submit button and i want to able and disable the button when the "i agree" box is checked or unchecked, can you show me how to do it? thank you.


Top
 Profile  
 
  Re: able and disable a submit button
PostPosted: July 7th, 2009, 8:43 pm 
User avatar

Posts: 136
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title></title>
<script type="text/javascript">
function activate(){
if(document.getElementById('agree').checked==true){document.getElementById('sendbutton').disabled=false;}
else{document.getElementById('sendbutton').disabled=true;}}
</script>
</head>

<body>
<input type="submit" id="sendbutton" disabled />
<input onclick="activate();" type="checkbox" id="agree" /><label for="agree">I agree</label>


</body>
</html>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

FORUMS » Client Side » HTML


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron