473,511 Members | 15,364 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 2208
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
3587
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,...
5
2582
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...
2
5447
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...
1
6673
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
11609
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...
5
2454
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...
22
2506
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
1229
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#...
1
2665
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...
19
2185
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? ...
0
7242
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,...
1
7075
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
7508
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...
0
5662
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,...
1
5063
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...
0
4737
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...
0
3222
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
1
781
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
446
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...

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.