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
• Save up to 80% on SSL Certificates, RapidSSL Certificate @ $ 11.00/yr.
• help me
• Re: substitute of goto in java???
• Re: store string from text file to vector
• Re: c# .net Exception of type System.StackOverflowException was thrown.
• Re: error: expression must have a constant value
• Re: Script Does Folder Exist – If Not Create It
• $_GET not working
• GET METHOD


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-2010