473,804 Members | 3,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I want change the color of the panel if i click checkbox using javascript

8 New Member
This is my UserControl(asc x) coding, it is not working plz help me to rectify the error.....what is wrong in that one.....

<%@ Control Language="vb" AutoEventWireup ="false" Codebehind="Use a.ascx.vb" Inherits="HIS.U sea" TargetSchema="h ttp://schemas.microso ft.com/intellisense/ie5" %>
<script language="javas cript" type="text/javascript">
function output()
{
var xx = document.getEle mentsByName("cb test").value;
// var xx=document.for ms.item('cbtest ');
//document.m
//var xx= document.forms. cbtest.checked= true;
// var mainForm=docume nt.mainForm.cbt est;
if (xx.checked ==true)
{
document.getEle mentById("Panel 1").style.backg roundColor= "#ffff00";
return true;
}
if(xx.checked == false)
{
document.getEle mentById("Panel 1").style.backg roundColor= "#90dd90";
return false;
}
}
</script>
<asp:panel id="Panel1" BackColor="Yell owGreen" runat="server" Width="56px" Height="40px" BorderStyle="No ne"
ToolTip="seat">
<asp:Image id="Image1" runat="server" Width="32px" Height="32px" ImageAlign="Mid dle" ImageUrl="file:///\\system107\HIS \Images\seat2.j pg"></asp:Image>
<INPUT id="cbtest" onclick="output ()" type="checkbox" name="cbtest" runat="server">
<asp:Label id="Label1" runat="server" Width="32px" Font-Size="X-Small" Font-Names="Verdana" ></asp:Label>
</asp:panel>
May 5 '07 #1
2 1409
kenobewan
4,871 Recognized Expert Specialist
What error are you getting?
May 5 '07 #2
itsenthil
8 New Member
What error are you getting?

'Checked' is null or not an object
May 5 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
12737
by: Alexandre Jaquet | last post by:
Hi, I would like to know how can I change a row background color when an user select a row thx
7
2228
by: ThunderMusic | last post by:
Hi, I have a CheckBoxList and I want to add some javascript code to each CheckBox created by this CheckBoxList. I tried iterating through all items of the list, all the controls, do a FindControl, et al. with no good result. I would use the Control.Attribute.Add("OnClick", "some javascript code") Does someone know a solution? Thanks
3
1950
by: Softimax | last post by:
Hi! I want to change the position of a generic control. I want to append it to a different parent. I try some methods but I have some problem with complex controls (like dropdown, checkboxlist) I wrote a simple code for testing. If you try to check something and write in textbox, after two click you lose only checkboxes!
10
3597
by: apparker | last post by:
I'm creating a new GUI for a program and it is for a medical exam. There are so many different things to ask someone during a history it wastes too much space to make checkboxes for everything so I had an idea: Can I simply create a list of conditions and when the doctor clicks them, they turn red? And clicking them again would make them default again? This would really make the exam better since the doctor could quickly glance at a...
1
2478
by: itsenthil | last post by:
This is my Usercontrolcoding. what is wrong in this coding plz help me <script type="text/javascript" language="javascript"> function output() { var cb =document.getElementById("cbtest"); if(cb.checked == true)
2
1754
by: itsenthil | last post by:
This is my userControl(ascx) file if run this one i got object required error........ What is wrong in that one plz help me....it is very urgent..... <%@ Control Language="vb" AutoEventWireup="false" Codebehind="Usea.ascx.vb" Inherits="HIS.Usea" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %> <script type="text/javascript" language="javascript"> function output() { var xx =...
0
1635
by: Abbas82 | last post by:
Hi, I have a nested DIV structure where both have an onclick event, hence I am cancelling the event from bubbling up to the outer DIV, but this has caused the Panel to remain opened when I click on another dropdown (in another item within my repeater) or anywhere else on the page, and I am wondering if anyone knows how to close the panel manually using the AjaxControlToolkit.DropDownBehavior? Here is some source code: <asp:Repeater...
3
4325
by: dugald.morrow | last post by:
I have some javascript that updates the text in a text field after certain actions take place such as clicking a checkbox. The javascript works fine in Safari and Firefox, but in IE, the text in the text field remains empty. The page containing this problem is at the following location: http://www.skicow.com/component/option,com_skicow/act,shop/Itemid,51/debug_enabled,true The last parameter enables debug which results in alerts...
5
6125
by: sklett | last post by:
I know that Panel (and most of it's derivitives) don't raise keyboard events. I *really* need to catch keyboard events though so I've been googling the topic and have found quite a few suggestions. The one suggestion I've found that makes the most sense isn't working for me and after this most recent failure I'm really at a loss! ;0) I'm overriding WndProc and checking the Message.Msg property for the WM_KEYUP message. If anyone has...
0
9708
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9588
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10340
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9161
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7625
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6857
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4302
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.