Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > Pro JSP
|
Pro JSP Advanced JSP coding questions. Beginning questions will be redirected to the Beginning JSP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro JSP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 17th, 2006, 03:14 PM
Authorized User
 
Join Date: Mar 2005
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Default Enabling Checkbox

I have login page that displays a link to a pdf file, a checkbox and label that is disabled. When user clicks on link a 2nd window pops up with a pdf file and the checkbox and label needs to be enabled.

When the page initially loads the link, checkbox, and label is not visible. Employee logs in and there's a lookup to a table that contains all PDFs that need to be viewed. If there are any PDFs, the link of the pdf name, checkbox, and label become visible, but the checkbox and label are disabled.

My problem is that using the code below, the label becomes enabled, but the checkbox stays disabled.

What am I doing wrong? Does the checkbox and label not work the same way? Any help would be greatly appreciated.

Thanks,
Ninel

This is my code:
Code:
HTML:
<script language="javascript">
function toggleInputElementsDisabledStatus()
{
     var elem = document.getElementById("chkRead");
     if (elem != null)
     {
           elem.disabled = !elem.disabled;
     }

     var elem = document.getElementById("lblRead");
     if (elem != null)
     {
           elem.disabled = !elem.disabled;
     }
}
</script>

<asp:label id="lblRead" runat="server" Font-Names="Tahoma" Font-Size="x-Small" Width="280px" enabled="False">I have read the new/updated policies</asp:label>
<asp:checkbox id="Read" runat="server" Font-Names="Tahoma" Font-Size="x-Small" enabled="False" ></asp:checkbox>
 
Old April 27th, 2006, 04:25 AM
Authorized User
 
Join Date: Mar 2006
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Try with this :-

elem.setAttribute("disabled", "false");






Similar Threads
Thread Thread Starter Forum Replies Last Post
Enabling form elements on click of checkbox Shuchik Classic ASP Basics 2 September 12th, 2007 02:53 AM
Enabling error messages halfnote5 Access 2 September 6th, 2007 11:06 AM
Enabling Optical Mouse js_newbie Linux 3 July 5th, 2007 04:18 AM
checkbox checked by default by html:checkbox sachin.tathod Struts 3 December 4th, 2006 03:41 PM
Enabling mail server vkshrestha ASP.NET 1.0 and 1.1 Professional 0 May 16th, 2006 12:18 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.