codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  How to deactivate button  sunpetok at 23:12 on Thursday, August 23, 2007
 

I need help on how to deactivate a button if a visitor to my site do not click on the check box in agreement with my policy. I want the checking of the box to prompt the activation of the button in other to proceed to the next step of the registration procedure.

  Re: How to deactivate button  webdev at 01:03 on Monday, December 14, 2009
 

use a javascript function and create a checkbox for TOS if he click the checkbox then set the submit button attribute to disabled something like this
function tos(checkbox){
if(checkbox.value == true)
document.getElementById("button_id").disabled = "disabled";
else
document.getElementById("button_id").disabled = false;
}

---code for checkbox--
<input type="checkbox" onclick="tos(this)">

  Re: How to deactivate button  joshuab at 19:52 on Monday, December 14, 2009
 

better make the required button deactivate(disable)by writing

button1.enable=false;
in form load
and make it enable only when the user checks the checkbox.

write the below code in checkbox_checked change event
if(checkbox1.checked==true)
{
button1.enable=true;
}
if(checkbox1.checked==false)
{
button1.enable=false;
}


Web Development Services









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Cheap SSL Certificate Coupon Codes, RapidSSL Certificate @ $7/Yr
•  Re: Stored procedure do not return recordset
•  Re: Problem in Calling Stored Proceedure from ASP
•  Re: Customizable Event Calender, using C#
•  Re: script modification: show div on mouseover
•  Re: javascript, get the color assigned by class
•  Re: import contacts of msn/yahoo
•  Re: Incrementing a date field using javascript via prompt
•  Re: I need a code to make a forum on a website


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2011