473,395 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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

Expand|Select|Wrap|Line Numbers
  1. <%@ Control Language="vb" AutoEventWireup="false" Codebehind="Usea.ascx.vb" Inherits="HIS.Usea" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>
  2. <script type="text/javascript" language="javascript">
  3.         function output()
  4.         {
  5.          var xx = document.getElementById("cbtest").value;
  6.         //var mainForm=document.mainForm.id("cbtest");
  7.         if (xx.checked == true) 
  8.         {
  9.         document.getElementById("Panel1").style.backgroundColor= "#ffff00";
  10.         return true;
  11.         }
  12.         if (xx.checked == false) 
  13.         {
  14.         document.getElementById("Panel1").style.backgroundColor= "#9acd32";
  15.         return false;
  16.         }
  17.        }
  18. </script>
  19. <asp:panel id="Panel1" BackColor="YellowGreen" runat="server" Width="56px" Height="40px" BorderStyle="None"
  20.     ToolTip="seat">
  21.     <asp:Image id="Image1" Height="32px" Width="32px" runat="server" ImageUrl="file:///\\system107\HIS\Images\seat2.jpg"
  22.         ImageAlign="Middle"></asp:Image>
  23.     <INPUT id="cbtest" onclick="output()" type="checkbox" name="cbtest" runat="server">
  24.     <asp:Label id="Label1" Width="32px" runat="server" Font-Names="Verdana" Font-Size="X-Small"></asp:Label>
  25. </asp:panel>
May 8 '07 #1
2 1736
RedSon
5,000 Expert 4TB
Moving to VB since its coded in VB. This might need to move around further but I'll let the helpful folks in VB take a shot at it first.
May 8 '07 #2
Moving to VB since its coded in VB. This might need to move around further but I'll let the helpful folks in VB take a shot at it first.

ok Thanks....
May 9 '07 #3

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

Similar topics

3
by: Noozer | last post by:
I have several tags on a webpage of the same class. If the user clicks a specific checkbox I'd like to be able to alter the display property of the class, affecting all objects of that class. ...
4
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
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,...
3
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) ...
10
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...
1
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...
2
by: itsenthil | last post by:
This is my UserControl(ascx) coding, it is not working plz help me to rectify the error.....what is wrong in that one..... <%@ Control Language="vb" AutoEventWireup="false"...
0
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...
3
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...
5
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...

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.