473,585 Members | 2,467 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Html and Javascript changing "disabled"

34 New Member
This is my code:
index.php
Expand|Select|Wrap|Line Numbers
  1. // SOME HTML
  2. <script language = "javascript" src = "js/common.js"></script>
  3. <script language = "javascript" src = "js/register.js"></script>
  4. // SOME HTML
  5. <body class = "body_uc" id = "body" onload = "ClearPageLoad();   PopIMG(); setready(); enable_reg(1)" >
  6. // SOME HTML
  7. <form action = "?a=r" method = "post" name = "reg_frm">
  8. <input type = "text" id = "reg_account" name = "account" onfocus = "reg_reminder(1);" disabled = "disabled" onBlur = "reg_reminder(0); Check(this.id, this.value); CheckAccount(this.value);" />
  9. </form>
  10. // SOME HTML
  11.  
register.js
Expand|Select|Wrap|Line Numbers
  1. ready = 0;
  2. function setready() {
  3. ready = 1;
  4. }
  5. function PopIMG () {
  6. var d = document.getElementById("ivi");
  7. if (ir != 1) {
  8. d.innerHTML = '<img id = "ivIMG" src = "ImgValid.php?refresh=none" />';
  9. var rnd = Math.random();
  10. var sto = "document.getElementById('ivIMG').src = 'ImgValid.php?refresh=" + rnd + "';";
  11. ir = 1;
  12. setTimeout(sto, 1500);
  13. }
  14. }
  15.  
  16. function enable_reg(wi) {
  17. if(!wi || wi == 0) {
  18. var wi = 0;
  19. }
  20. alert(document.reg_frm.account.disabled);
  21. document.reg_frm.account.disabled = "false";
  22. document.getElementById('reg_password').disabled = "false";
  23. alert(document.reg_frm.account.disabled);
  24. }
  25.  
common.js
Expand|Select|Wrap|Line Numbers
  1. function ClearPageLoad() {
  2. var x = document.getElementById("loadingbar");
  3. x.innerHTML = '';
  4. x.style.visibility = 'hidden';
  5. }
  6.  
Why it didn't alert true and false when the page onload?

IT only ALERT false and false!

i have changed the disabled status, but it didn't!

How to fix this?

Thanks!
Jul 20 '10 #1
3 2214
acoder
16,027 Recognized Expert Moderator MVP
Instead of the string "false", set it to false.
Jul 20 '10 #2
Kong Chun Ho
34 New Member
Thanks!

It works!
Jul 21 '10 #3
acoder
16,027 Recognized Expert Moderator MVP
No problem.

Yeah, a big difference between "false" and false.
Jul 21 '10 #4

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

Similar topics

2
3592
by: Askari | last post by:
Hi, I do a "perso"widget where have two scrolls (one vertical, one horizontal) for a canvas. When, the first time, I added widget in the canvas, the scroll self-ajust and when I move scrollbar, the surface's canvas "moved". But when I deleted (.destroy) this first widgets and that a added other widget, the scrollBar become disabled (ajust...
5
2590
by: Jeremy Langworthy | last post by:
Hi I have two "totals" inputs whose values are dynamically calculated. For obvious reasons I don't want users to be able to edit the information in these. However, I do want this total passed to the next page so I can store it. When I set the input to "disabled" it does not pass it's value. Is there another way I can do this? I was...
2
5456
by: CES | last post by:
All, I'm at a loss, the code below works in IE but not in Netscape and I'm unskilled enough not to know why. Essentially this code looks thru all of the form fields and if the input box has a attribute of disabled="true", attribute would only be present if the field was disabled, then the label field's class is changed to a grayed out...
1
6677
by: Kruse | last post by:
Hi, Is Possible to alter the "disabled" style? I have got <input name="test" value="1" disabled> This makes the input field gray and shadow.
1
11623
by: Ittay Dror | last post by:
Hi, I have a form with various elements which, according to changes in values become enabled or disabled. The disabled elements are normally not submitted, but I wish they were. How can I go about making elements appear to be disabled, but still send them when the form is submitted. Thanx,
5
2466
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...
22
2518
by: David. E. Goble | last post by:
Hi All; I have a few of these; sigsImages="sigs/finished1.jpg" sigsImages="sigs/foghorn.jpg" lower I have;
0
1231
by: Dana Epp | last post by:
Anyone know how to set the "Disabled" imagelist in a C# Toolbar? Although the Microsoft's Toolbar ActiveX control in the mscomctl.ocx has such a property, there doesn't seem to be one for the C# version. Anyone know a work around for this? --- Regards, Dana M. Epp http://silverstr.ufies.org/blog/]
1
2666
by: Morten Plathe | last post by:
Hi, Is there a way to override the shadowed (grey) backcolor of a textbox when the textbox is disabled for input (textbox.enabled = false) ? In some cases I want to have a custom backcolor when the textbox is disabled. The same question applies for a listview. When the listview is disabled, the backcolor of the listview turns grey...
19
2211
by: maya | last post by:
hi, so what is "modern" javascript?? the same as "DOM-scripting"? i.e., editing content (or changing appearance of content) dynamically by massaging javascript objects, html elements, etc? (in conjunction with css, you know, the usual...;) this is what is meant by "modern" javascript?? so how do folks feel about this who think...
0
7908
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...
0
7836
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...
0
8199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
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...
1
7950
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...
0
8212
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...
0
6606
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...
1
5710
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...
0
5389
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...

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.