473,804 Members | 3,091 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

button.disabled - firefox vs IE difference


Hi, say we have the code below on a button:

<input type="button" class="btn" value="Continue " onclick="if
(myform.p_name. value=='') alert('You must enter a name for the folder');
else { this.disabled=t rue; submit();}">

Not all the validation can be performed client-side so the button may be
pressed and then server validation is performed - this may result in a
request to the user to hit the back button and correct some data
entered.

Now this isn't the best UI design, I know. But nonetheless we have to
stick with this for a qhile and I have noticed a difference in the way
Fireforx and IE handles the button disbaling. On IE, when you go back to
the page, the button is enabled again whereas in Firefox it remains grey
and disabled.

Can anyone suggest a way in which we can automatically re-enable the
button when the user presses the back button? Is there some code we can
put into the onload perhaps which will go through all buttons on the
form and enable them?

Appreciate your suggestions.

--

jeremy
Mar 24 '06
26 21303
Jeremy wrote:
Hi, say we have the code below on a button:

<input type="button" class="btn" value="Continue " onclick="if
(myform.p_name. value=='') alert('You must enter a name for the folder');
else { this.disabled=t rue; submit();}">

Not all the validation can be performed client-side so the button may be
pressed and then server validation is performed - this may result in a
request to the user to hit the back button and correct some data
entered.

Now this isn't the best UI design, I know. But nonetheless we have to
stick with this for a qhile and I have noticed a difference in the way
Fireforx and IE handles the button disbaling. On IE, when you go back to
the page, the button is enabled again whereas in Firefox it remains grey
and disabled.

Can anyone suggest a way in which we can automatically re-enable the
button when the user presses the back button? Is there some code we can
put into the onload perhaps which will go through all buttons on the
form and enable them?

Appreciate your suggestions.


Sory for the stupid question, but why are you disabling that button in
the first place ? If the user happens to click it again while the next
page is loading, the server validation will fail again.

To the point - since onload will not fire, how about a timer event to
enable the button few seconds after page has been re-rendered (i.e. Back
button pressed) ? Btw. you can save your user pressing the Back button
by sending "Location" in HTTP response header on failed server validation.

Roman
Mar 25 '06 #11
Roman wrote:
Sory for the stupid question, but why are you disabling that button in
the first place ? If the user happens to click it again while the next
page is loading, the server validation will fail again.
I think this was an approach to reduce server load.
To the point - since onload will not fire, how about a timer event to ^^^^^^^^^^^^^^^ ^^^^^ enable the button few seconds after page has been re-rendered (i.e. Back
button pressed) ?
Because it cannot be detected if this event occurred.
Btw. you can save your user pressing the Back button by sending
"Location" in HTTP response header on failed server validation.


True. Therefore, it is better if the form is generated by a server-side
application. Redirection should be done so that this application can
recognize which input content was wrong or missing, and includes
information into the generated resource about those fields (marking
them in some way.) This allows for easier maintenance of the validator.

The best approach is to use the same application that is used for generating
the form, for server-side validation of the submitted data, so that in a
sense the form submits its data to its own document resource. No further
redirection would be necessary then, and maintenance would be a child's
play.
PointedEars
Mar 25 '06 #12
Merennulli said the following on 3/24/2006 3:14 PM:
*Turns the fire hoses on.* Would be nice to do without the flames...
OK but it wasn't a flame as I would call one.
Randy, the problem here isn't that he doesn't understand, it's that he
has a different philosophical approach.
Thomas has a Theoretical Approach, mine is a Realistic Approach. The
difference is huge.
Thomas is looking at it from the perspective of the future and the unknown.
I disagree with that.
Jeremy can't know if his closed environment is about to have the doors
opened to mobile devices, or perhaps someone with a visual impairment
gets hired to the team, and the javascript doesn't work for his screen
reader, or any other such scenario.
Sure you can. I know, precisely, what devices are and are not allowed on
the Intranet I work on. If I don't, then I can't have security and
considering that our Intranet deals with 10,000+ peoples personal
information a day then security is paramount.

Just out of curiosity though. Do you use CSS in your pages? And, do you
test it without the CSS?

He also can't know if someone on the team has circumvented
him and got permission from "upstairs" to connect his latest
nonstandard toy.
That is one concern that I don't have to deal with. Call it a luxury if
you want. Even my CEO knows how I can behave when somebody does
something that they shouldn't do on the Intranet. And, the person who
"gives permission upstairs" will take a bounce downstairs faster than
you can read this. It has happened and it will probably happen again.
If that happens, all this time he's spent developing
QnD solutions (now, and each subsequent time) is wasted. Taking this
opportunity to do it right also makes maintenance in the future much
faster and simple.

I agree with Thomas's thinking on this, just because you believe your
environment is controlled, doesn't mean it really is, or that it will
stay that way. It's called being a conscientious programmer.


I disagree but we are all entitled to our opinions.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 26 '06 #13
Thomas,
You're right, I didn't think that through all the way. I guess he could
do it onunload, so while the user is going forward it fires, preparing
it for when they come back. This is why I like doing server side code,
you can tie down the interface to controlled points.

Randy,
That's more than a luxury, it borders on being a fantasy world. I've
worked in several IT environments, three of which where I was the
decision maker on application deployment and where the environment was
supposed to be controlled. I have friends in dozens of other IT
environments. No matter how draconian the management structure, I've
never seen or heard of one (other than yours) be able to maintain
absolute control over what will be allowed on the network. Yes, they
can require everything go through checkpoints, but when I've been in
that situation, it mean that we had to support the pet hardware of
influential individuals, it never meant that everyone met our stated
standards or support level. Real security problems such as personal
wireless hubs, yes, that can be barred, but I've never been in a
position that allowed me to tell the president his PDA can't be used to
access our intranet over the existing wireless network.

I hope you don't take offense, but it sounds like even your level of
control is a self deception and part of a BOFH mentality. You even
state "It has happened and it will probably happen again." While you're
referring to the fact that your control of the network is supported, it
also demonstrates that your environment is subject to these unexpected
devices. You're justified in not supporting the devices, since you have
support above you to penalize offenders, but how long before the bubble
bursts and whoever is "bouncing" people downstairs on your behalf isn't
there anymore? Even a CIO can't fire a CEO for naively undermining the
IT infrastructure.

I do use CSS in nearly everything I've done since 2002, including
intranet apps, and I do test for lack of support for CSS, Javascript,
and text only (not inclusive, since both lynx and links currently
support limited Javascript). That sort of testing should be second
nature to any web developer, it shouldn't be a burdon to be dumped at
the first available opportunity.

Even those who stick with our "controlled " environment to the letter
have found ways of breaking my predecessor's pages. He created a notice
mailing form in Visual Studio using grid layout, and didn't lock the
format down with CSS, so people who upped their browser font size were
unable to click in fields where the label ran right over the top of
them. There is no substitute for planning your pages out so they
degrade gracefully.

Mar 28 '06 #14
Merennulli wrote:
Thomas,
You're right, I didn't think that through all the way. I guess he could
do it onunload, so while the user is going forward it fires, preparing
it for when they come back. This is why I like doing server side code,
you can tie down the interface to controlled points.


Not understood. I have never mentioned `onunload' regarding this, I
recommended `onsubmit' (instead of `onclick'). `onunload' code is executed
when one navigates away from the document or the window is closed. That
does not help here because you cannot re-enable the controls later if the
Back feature is used. There is no event to handle this, at least no
interoperable one that I know of.

Please reply to the posting you are referring to, and quote the minimum
of that. NetNews is thread-based, a public discussion displayed as a
tree structure; therefore, your current posting style, originating from
bulletin boards, is not wanted here.

<URL:http://jibbering.com/faq/faq_notes/pots1.html>
PointedEars
Mar 29 '06 #15
Thomas 'PointedEars' Lahn said the following on 3/28/2006 11:17 PM:
Please reply to the posting you are referring to, and quote the minimum
of that.
Yes, please do.
NetNews is thread-based, a public discussion displayed as a tree structure;
Only if the UA you are using supports tree structures.
therefore, your current posting style, originating from bulletin boards,
is not wanted here.
The current posting style is not wanted, but where or what software they
use is irrelevant as long as they follow the requested norms of posting
here. To say that people who post from "bulletin boards" (GoogleGroups
is *not* a "bulletin board" though) is complete rubbish. This is an open
group and *anybody* is allowed to post here. So please stop telling
people that garbage.
<URL:http://jibbering.com/faq/faq_notes/pots1.html>


Nothing in that document says that "bulletin board posters" are not
wanted here.
--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 29 '06 #16
Randy Webb <Hi************ @aol.com> writes:
Thomas 'PointedEars' Lahn said the following on 3/28/2006 11:17 PM:
NetNews is thread-based, a public discussion displayed as a tree structure;


Only if the UA you are using supports tree structures.


I'm also unfa,miliar with the name "NetNews". I first thought this was
referring to some web based Usenet gateway.
therefore, your current posting style, originating from bulletin boards,
is not wanted here.


The current posting style is not wanted, but where or what software
they use is irrelevant as long as they follow the requested norms of
posting here.


He didn't say otherwise, but just gave his opinion about the cause of
the style. I would probably have vagered on it being caused by Google
Groups hiding the "reply with quote" button instead of making it the
default.
To say that people who post from "bulletin boards"
(GoogleGroups is *not* a "bulletin board" though) is complete
rubbish. This is an open group and *anybody* is allowed to post
here. So please stop telling people that garbage.


Reread. He didn't.
/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Mar 29 '06 #17
Lasse Reichstein Nielsen said the following on 3/29/2006 12:50 AM:
Randy Webb <Hi************ @aol.com> writes:
Thomas 'PointedEars' Lahn said the following on 3/28/2006 11:17 PM:

NetNews is thread-based, a public discussion displayed as a tree structure;

Only if the UA you are using supports tree structures.


I'm also unfa,miliar with the name "NetNews". I first thought this was
referring to some web based Usenet gateway.
therefore, your current posting style, originating from bulletin boards,
is not wanted here.

The current posting style is not wanted, but where or what software
they use is irrelevant as long as they follow the requested norms of
posting here.


He didn't say otherwise, but just gave his opinion about the cause of
the style. I would probably have vagered on it being caused by Google
Groups hiding the "reply with quote" button instead of making it the
default.


Yes, that is the major flaw with Google Groups. If they changed the way
it quotes the only way you could tell it came from Google would be the
headers. But as it is, just seeing a post without being quoted is a
pretty good indication of Google Groups posting.
To say that people who post from "bulletin boards"
(GoogleGroups is *not* a "bulletin board" though) is complete
rubbish. This is an open group and *anybody* is allowed to post
here. So please stop telling people that garbage.


Reread. He didn't.


I had to read it three more times and two cups of coffee to read it a
different way. The first four times I read it I got the implication that
posting from a "bulletin board" is unwanted. I can see where it implies
the posting style and how Google might cause that behavior. He should
have been a little clearer in what he said though.

But for now, he can have the benefit of the doubt on it.

And, this quote is all over Usenet and could have been given or referred to:

Please quote what you are replying to.

If you want to post a followup via groups.google.c om, don't use the
"Reply" link at the bottom of the article. Click on "show options" at
the top of the article, then click on the "Reply" at the bottom of the
article headers.
<URL: http://www.safalra.com/special/googlegroupsreply/ >

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Mar 29 '06 #18
Lasse Reichstein Nielsen wrote:
Randy Webb <Hi************ @aol.com> writes:
Thomas 'PointedEars' Lahn said the following on 3/28/2006 11:17 PM:
NetNews is thread-based, a public discussion displayed as a tree
structure; Only if the UA you are using supports tree structures.


AFAIK "displayed" does not necessarily mean "depicted". The tree structure
is created by Message-ID headers of postings, and References headers of
followups to contain them.
I'm also unfa,miliar with the name "NetNews". I first thought this
was referring to some web based Usenet gateway.


Not at all. NetNews (network news) is the UUCP/NNTP-based communication
medium, with Usenet, including this newsgroup, being a subset of it. It
would be equally correct, but not equally sufficient, to say that Usenet
is thread-based.

<URL:http://en.wikipedia.or g/wiki/Usenet>

HTH

Regards,
(F'up2) PointedEars
Mar 29 '06 #19
Thomas 'PointedEars' Lahn wrote:
Not understood. I have never mentioned `onunload' regarding this, I
recommended `onsubmit' (instead of `onclick'). `onunload' code is executed
when one navigates away from the document or the window is closed. That
does not help here because you cannot re-enable the controls later if the
Back feature is used. There is no event to handle this, at least no
interoperable one that I know of.
As I said: "so while the user is going forward it fires, preparing it
for when they come back."
My purpose in mentioning an "onunload" alternative is clear, even
without reading your prior post. Onunload fires as the page is being
exited, so changes it makes would only affect the cached version of the
page. When you hit the back button, you pull up the cached version of
the page (hence the lack of onload), which you already altered as you
left the page. It's not using the back button as an event, it's
preparing the page for when you go back to it.
Please reply to the posting you are referring to, and quote the minimum
of that. NetNews is thread-based, a public discussion displayed as a
tree structure; therefore, your current posting style, originating from
bulletin boards, is not wanted here.


My style of response comes from the fact that I made the apparently
false assumption that everyone here could follow a conversation without
everything repeated any time someone speaks.

There is no policy statement here of how I should post. I quote when
I'm responding to something specific, and I will respond without quotes
when I'm responding to larger sections that require you to have read
the previous post(s) in entirety. These off topic tirades are "not
wanted" as well.

And yes, as Randy suggested, I'm viewing this through Google Groups,
which displays previous posts right above responses, but any decent
mail or news client can sort by topic. I've been on mailing lists and
newsgroups for 8 years, and your insistence on your posting style is
your own preference, not the ubiquitous or official style of a
particular format.

Randy, thank you for your later response that took into account the
interface I'm using and requested I accommodate the structure of your
interface rather than dismissing my response as "not wanted". Needless
abrasiveness such as that "not wanted" is what kills online user
groups.

Mar 31 '06 #20

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

Similar topics

5
28576
by: bart plessers | last post by:
Hello, Somewhere in my code I have <input TYPE="button" NAME="btnFirst" VALUE="<<" OnClick="GetFile('1')" DISABLED> I changed the layout of the INPUT with a stylesheet to INPUT { color: #FFFFFF;
7
1452
by: John Smith | last post by:
As it is now apparently illegal in the UK to produce a website which is inaccessible to the disabled, which includes the JavaScript-disabled and images-disabled, am I right in thinking that the only ASP.NET postback capable control which is now of any use is the Button control? The LinkButton is clearly no good as it uses JavaScript and the ImageButton doesn't work in Mozilla with scripting and images turned off. Am I missing something or...
2
2320
by: xazos79 | last post by:
Hi All, I've come across the problem of not being able to re-enable a radio button with javascript if its initial state has been disabled in the Page_Load() method of the code behind. Might i add that it behaves fine in Firefox, but IE is unable to re-enable the radio button. IE is fine if the radio button starts in an enabled state.
1
6150
by: Phil_Cam | last post by:
Hello All On a webpage I have a standard paypal image button for purchases. I am trying to set it up so that it only shows up or is endabled when text is entered into a textbox and a button is pressed. To do this I set the type to hidden and changed the type of the button using javascipt to image. This works perfectly in Modilla's Firefox but in IE it says there is a scipt error. Here is the javascipt
11
7389
by: Joey | last post by:
Hello, In my C# asp.net 2.0 application, I have a webform with a button server control on it. The webform, like most others in the site, subscribes to a master page. I have determined that the button always renders with an id of "ct100_ContentPlaceHolder1_btnContinue" in both the IE and Firefox browsers. I created the following javascript code segment to disable it when the page loads. I have reasons for not wanting to do this with...
2
7719
by: bay_dar | last post by:
Hi, I have an internal ASP.NET application that I'm are using to send e-mails out based on a single milepost or milepost range entered. I'm trying to do two things when a user clicks on the submit button to submit a form that contains one or two Mileposts: 1) If a Milepost range larger than 5 miles is entered, I would like to pop up a confirmation box to confirm the range.
4
1725
Plater
by: Plater | last post by:
I am up to my neck in javascript troubles these days. Ok so I have a button on my webpage with an onclick event. In the onclick event I do the following: Disable the button (so they can't click it again) Change the text on the button (the value) Perform an xmlHttpRequest.send() (I think it's asynchronous since I do this: http.onreadystatechange = handleSendTestEmailResponse;) And in my statechanger function, when I decide it's done...
1
2252
by: arggg | last post by:
I created a submit form that calls a javascript:AjAX Command that will call the data and submit it without have the page refresh. This works perfect in Firefox however in IE and Opera when the submit button is pressed it just disables the button and does not submit the data. Any idea? <script type="text/javascript" src="<?=$config->getKey('Site_URL')."js/AJAX.js"?>"></script> <form name="EditUser" method="post" accept="text/plain"...
0
9569
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
10558
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
10318
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...
0
10069
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
9130
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
5503
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
5636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2975
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.