473,769 Members | 4,999 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Toggle enable/disable form elements broken in IE

Here's what to look at:
http://sawyer.thookerov.net/request/itrequest.php
(script file: http://sawyer.thookerov.net/request/request.js

The form works fine in Firefox. Clicking on certain elements enables or
disables other elements as intended. The visual refreshes and sends
focus as needed.

However, using IE6, the visual does not refresh unless the user clicks
away from the control element (eg. open area of page, or clicking one
of the still-dimmed elements that should be available). Is there a flaw
in my code, or is it IE? i've also tried this page with XHTML
compliance and that doesn't work.
http://sawyer.thookerov.net/request/itrequestx.php

Any ideas? Any help is appreciated.

Jul 23 '05 #1
3 2310
joe t. wrote:

[snip]
However, using IE6, the visual does not refresh unless the user clicks
away from the control element (eg. open area of page, or clicking one
of the still-dimmed elements that should be available).
In the HTML specification, and the DOM 2 Events specification, the
change event is defined in terms of control focus and value change,
not just the latter. Microsoft's interpretation could be deemed the
most correct, but hardly the most useful in terms of checkbox usage.

You can use the click event instead, though it does have problems in
at least one browser (though I think that was NN4, so not too much to
worry about).
Is there a flaw in my code, [...]


There is one: you shouldn't disable elements via HTML. If it's
possible for a user to arrive at your form without client-side
scripting support (a possibility on the Web), the form will be useless.

[snip]

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #2
It was indeed the event handler. onClick fixed it in IE and preserved
functionality in FF. Thanks for the tip. Can't really remember why i
went with the change handler in the first place... :-?

Also, i realize initializing form elements in a specified status isn't
good practice, but this is a strictly internal page that my boss wants
me to "dummy-proof" as much as i can. So i figure if the user can't
enter random data unless deliberately choosing to do so, that's
helpful. Can't win all battles, but it might prevent some.
-joe t.

Jul 23 '05 #3
joe t. wrote:
[...] Can't really remember why i went with the change handler in
the first place... :-?
In principle, events like change are preferred as they don't imply any
device dependancy. However, click tends to be a synonym for activate
in most user agents.
Also, i realize initializing form elements in a specified status
isn't good practice, but this is a strictly internal page [...]


With internal stuff, you can get away with much more. However, that
only holds true if you know precisely what's being used, and how it is
set up.

Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9207
by: Bob Bedford | last post by:
I've this code: function checkdate(FormSubmit){ alert(document.getElementById('Mois').value); if(eval(document.getElementById('Mois'))>0 && eval(document.getElementById('Annee'))>0){ document.forms.getElementByID('SELECTCONSTRUCTOR').disabled = false; //can't reach the control here } else
3
2378
by: Jürgen Heyn | last post by:
Good morning, on form 2 input elements and 1 image are placed. The 1st (Index) one is "hidden", the 2nd ) is an empty textbox. When clicking the picture I would like to toogle a boolean value. (displayed in the textbox). The following function reacts correctly on the first click. Any further click as no effect (is returns "TRUE" in the textbox). Where is the mistake ? How can I solve the problem ? Thank you very much in advance.
1
1730
by: Shabam | last post by:
Is there a way to present a form to a user by default with all forms disabled, then when user clicks a link, the fields become enabled?
2
4944
by: Mel | last post by:
i want to diable all submit_buttons untill all my form elements are populated. how can i do that ? thanks
6
13138
by: Ben | last post by:
Here's what I have se far: <script type="text/javascript"> other_text.disabled = true; function other_text() { other_text.disabled = (other_check.checked == false)? false : true; } </script> <input type="checkbox" id="other_check" name="other_check"
1
4254
by: hortoristic | last post by:
We are using JavaScript to Enable/Disable certain fields on web pages based on business rules. A simple example is if when using an option type tag, and the two options are Yes and No. If YES is selected - enable a field to use the M$ Datepicker. Using the code below works for most of our fields, however the problem is that when the field is re-enabled - it remembers the original date or data prior to it being disabled - despite the...
3
3801
by: DBQueen | last post by:
I have a form with lines of controls. On some of the lines there are 3 controls (call them A,B,C); other lines have only control A. The controls have been numbered sequentially (Q20, Q21....Q76) and they were put onto the form in the numerical sequence. I have given the A's with B & C's on the same line a tag=1; B.tag=2, C,tag=2) I am trying to write 2 modules so that the following occurs (on Form_Current and 'A' Control_Before or...
2
3350
by: John | last post by:
Hi How can I create a toggle button on a toolbar that would enable/disable editing on the current form? Thanks Regards
4
4348
by: Neil Coleclough | last post by:
I am constructing a database to process product returns for my Company. I have a number of toggle buttons to identify the stage to which each return has been processed. For example, clicking the first button confirms that the goods are now in our building awaiting initial processing. This button then fires off an email to our warehouse staff alerting them to the fact. I want to restrict these buttons to single use, so that once the email...
0
10211
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10045
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
9994
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
9863
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
8872
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...
0
5299
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5447
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3959
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
2815
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.