When working on a site that may have some pages in SSL (the check out pages) and most pages not I use a function to switch between SSL and Non SSL pages. First, I set the non secure and SSL URL’s in the config file under appSettings: <add key=”SSLURL” value=”https://www.mydomain.com”/> <add key=”NonSSLURL” value=”http://www.mydomain.com”/> Next, in […]
Month: April 2007
JavaScript Code To Toggle Check Boxes
Here is some JavaScript code to toggle check boxes (same action as radio buttons). In the page load event register the JavaScript: chkTwoYear.Attributes.Add(“onclick”, “javascript: CheckTwoProgram(” + chkTwoYear.ClientID + “);”); chkFourYear.Attributes.Add(“onclick”, “javascript: CheckFourProgram(” + chkFourYear.ClientID + “);”); In the HTML of the page add the JavaScript: <SCRIPT Language=”JavaScript”><!– function CheckTwoProgram(id) { if(id.checked) document.forms[0].chkFourYear.checked=false; } function CheckFourProgram(id) { if(id.checked) document.forms[0].chkTwoYear.checked=false; } //–> </SCRIPT>