473,776 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disabled property issue with JS objects

21 New Member
Hi All,

I am using this funcion to manipulate form elements;
every thing works fine except the reference to the disabled property.

Any help (the property works fine when used in classic manner)?

Thanks!

G

function getObj(name)
{
if (document.getEl ementById)
{
this.obj = document.getEle mentById(name);
this.style = document.getEle mentById(name). style;
this.disabled = document.getEle mentById(name). disabled;
}
else if (document.all)
{
this.obj = document.all[name];
this.style = document.all[name].style;
this.disabled = document.all[name].disabled;
}
else if (document.layer s)
{
this.obj = document.layers[name];
this.style = document.layers[name];
this.disabled = document.layers[name].disabled;
}
}
May 19 '07 #1
1 1420
acoder
16,027 Recognized Expert Moderator MVP
I can only assume that you're trying to access an object which doesn't support the disabled property.
May 21 '07 #2

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

Similar topics

1
6218
by: David Wake | last post by:
I have two radio buttons and two checkboxes in a form. I'm trying to write some code so that when a radio button is selected, its corresponding checkbox is disabled. My code looks like this: function radioClicked(index) { document.table_config_form.my_checkbox.disabled = true;
5
2478
by: Mark Hannon | last post by:
I have been researching the "disabled" property for form data and wanted to know: - Does the disabled property supress the form item from being submitted? - Can the disabled property be applied when the submit button is pressed? I am designing a PayPal order page that will have 4 items, each with a 3-character text box where the customer will enter quantity. The default value will be "0." I want to be able to test whether the
3
5158
by: Kelly Domalik | last post by:
I would like to override the "disabled" property of a hidden field. When disabled is set to "true", it would call a function to disable 2 other text fields on the form. When disabled is set to "false", it would enable those 2 text fields. You should also be able to get the value of it as if it were a property: alert(my_hidden_field.disabled); Is there any way to do this? Many thanks to anyone that can help.
8
5437
by: CsaaGuy | last post by:
I have a requirement to disable some textboxs depending on their contents. I choose to do this by invoking some javascript. When they change the contents, i disable the textbox they just put new data into and focus on another textbox. My logic works fine, the textboxes get disabled. However, when the page posts back, the disabled textbox contents (which were changed before disabling) DOES NOT GO BACK TO THE SERVER. The server gets the...
3
8388
by: WayDownUnder | last post by:
I have a datagridview that is bound to a cutom collection. The classes contained in the custom collection have the properties that are bound to the class . This works fine ! But if one of the properites exposes another object I would like to bind a property of the sub object to the DataPropertyName this does not seem to work. eg main object customer has a property called Address which is a contained object inside object Address there...
3
1860
by: moshi | last post by:
Hey, I'm working with asp.net 2.0. I make objects (like ddl, textbox...) disabled=true in client side. Then, when I get to the server in post action, these objects lose their value. For example: ddl comes back after postback with the first values in it's list - it doesn't keep the new value that the user chooses, and textbox - still remains it's last value, like the user didn't alter it. What I'm trying to say is that making object on...
5
2315
by: freeskier | last post by:
Hello, When a textbox's enabled property is set to false it becomes shaded and is clearly disabled. When I set the form's enabled property to false the text boxes are disabled but still look the same. Is it possible to shade out the text boxes without setting each individual property? Or can I set the property of all objects on a form? Thanks
2
1811
by: CreativeMind | last post by:
hi i have following code but problem is that when i debug both checkboxes have disabled property always false whether it is checked or unchecked..thx for help. function checkFinance(){ var chk1=document.getElementById("_ctl0_ContentPlaceHolder2_chkFinance");
7
1400
by: Revathi Balakrishnan | last post by:
Hi All If i use the below code i am able to disable the style sheet of a document. But i wanted to understand how this disabled property works internally? becaues in html normally if we do any change that will be reflected only after refresh. but here the stylesheet change of a html document is achieved with out any refresh. i want to understand how this achieved. Can any one help me? <html> <head> <link rel="stylesheet"...
0
9628
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
9464
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
10122
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...
1
10061
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9923
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
8954
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
7471
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...
1
4031
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
2860
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.