Sorry if this is a known problem with IE, but I was surprised to find that
the following code snippet works OK in Firefox but not in IE6:
else if (Form1.DogSex.v alue == "?") {
alert ("Please select Dog Sex");
Form1.DogSex.fo cus(); }
The control is defined in a table as follows:
<TR><TD>Sex of dog: </TD><TD<SELECT NAME="DogSex">
<OPTION>?</Option<OPTION>M ale</Option<OPTION>F emale</Option</TD></TR>
In Firefox the default "?" is recognized and the alert is displayed. In IE6
it is not. Maybe there is a better way to detect that a viable option was
not selected? My complete web page is at: http://www.smart.net/~pstech/DogLicenseJS.htm
I had posted my initial newbie questions on the Microsoft Jscript NG, but
my questions are probably applicable to JScript and JavaScript. I really
don't know how to tell the difference.
Thanks,
Paul 3 2111
Paul E. Schoen said the following on 9/8/2007 1:55 AM:
Sorry if this is a known problem with IE, but I was surprised to find that
the following code snippet works OK in Firefox but not in IE6:
else if (Form1.DogSex.v alue == "?") {
alert ("Please select Dog Sex");
Form1.DogSex.fo cus(); }
The control is defined in a table as follows:
<TR><TD>Sex of dog: </TD><TD<SELECT NAME="DogSex">
<OPTION>?</Option<OPTION>M ale</Option<OPTION>F emale</Option</TD></TR>
In Firefox the default "?" is recognized and the alert is displayed.
But, it doesn't have a value attribute. That is well known about - to
some - that IE won't give it a value based on the text. Simple solution:
<option value="?">?
<option value="Male">Ma le
<option value="Female"> Female
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
"Randy Webb" <Hi************ @aol.comwrote in message
news:ib******** ************@gi ganews.com...
Paul E. Schoen said the following on 9/8/2007 1:55 AM:
>Sorry if this is a known problem with IE, but I was surprised to find that the following code snippet works OK in Firefox but not in IE6:
else if (Form1.DogSex.v alue == "?") { alert ("Please select Dog Sex"); Form1.DogSex.fo cus(); }
The control is defined in a table as follows:
<TR><TD>Sex of dog: </TD><TD<SELECT NAME="DogSex"> <OPTION>?</Option<OPTION>M ale</Option<OPTION>F emale</Option> </TD></TR>
In Firefox the default "?" is recognized and the alert is displayed.
But, it doesn't have a value attribute. That is well known about - to
some - that IE won't give it a value based on the text. Simple solution:
<option value="?">?
<option value="Male">Ma le
<option value="Female"> Female
That worked perfectly. Are there other inconsistencies among browers? Any
way to find out what they are? I found some information on: http://www.quirksmode.org/js/intro.html http://developer.mozilla.org/en/docs...rer_to_Mozilla
Thanks.
Paul
Paul E. Schoen said the following on 9/8/2007 3:19 AM:
"Randy Webb" <Hi************ @aol.comwrote in message
news:ib******** ************@gi ganews.com...
>Paul E. Schoen said the following on 9/8/2007 1:55 AM:
>>Sorry if this is a known problem with IE, but I was surprised to find that the following code snippet works OK in Firefox but not in IE6:
else if (Form1.DogSex.v alue == "?") { alert ("Please select Dog Sex"); Form1.DogSex.fo cus(); }
The control is defined in a table as follows:
<TR><TD>Sex of dog: </TD><TD<SELECT NAME="DogSex"> <OPTION>?</Option<OPTION>M ale</Option<OPTION>F emale</Option> </TD></TR>
In Firefox the default "?" is recognized and the alert is displayed.
But, it doesn't have a value attribute. That is well known about - to some - that IE won't give it a value based on the text. Simple solution:
<option value="?">? <option value="Male">Ma le <option value="Female"> Female
That worked perfectly. Are there other inconsistencies among browers?
About a million of them.
Any way to find out what they are?
Experience and asking here when you encounter one.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javas cript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/ This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: cjl |
last post by:
Hey all:
Just getting my feet wet with javascript. The following script works
fine in Firefox, but won't run in IE. In fact, I've included this
script as an external file in the <head> of my html file, and the
remainder of the page doesn't load at all in IE. If I remove the
<script>, the page loads in IE.
var images = new Array();
var firstImage = 2;
|
by: CalgaryWebGuy |
last post by:
Please help,
My class assignment is due today and I am all finished except for one
small portion.
The instructor wants us to import a script from somewhere else, and for
some reason I deceided to make it more complicated than it needs to be.
What I am trying to do is create a popup when the user leaves the page
( I know pop-ups are bad, but they are a part of the course) that
|
by: ranger7419 |
last post by:
I'm trying to figure out why this script will work in IE 6 but not
Firefox, and so I need someone here with a far better grasp on
javascript to explain this. Basically, I have a page with several
thumbnails. Above these thumbnails I placed a large picture with text
next to it to describe what the picture is about. So, when you click a
thumb, the large pic AND text change dynamically to reflect the
thumbnail -- see...
|
by: alexphd |
last post by:
This code works in firefox perfectly, but in Internet Explorer it does not calculate the total correctly. Anybody know why?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en" dir="ltr">
<head>
<title>Order form</title>
|
by: Rollie72 |
last post by:
Hello,
This is a first time post for me.
Have this HTML form being validated by a javascript. I am having a
problem with the line "document.ACLinfo.BUmanager.value=manager;" .
When in Firefox this line executes correctly , the BUmanager field is
updated and the information is passed to the cgi script. When in IE it
appears not to execute properly, the resulting cgi script still
contains the default value and was not overwritten with...
| |
by: rupeshpradhan |
last post by:
<html>
<script language="JavaScript" type="text/JavaScript">
// initiliaze
index=0;
// create array and populate
message=new Array();
message='namaste';
message='goodbye';
|
by: burtonfigg |
last post by:
I'm testing an ajax page - this works fine in Firefox:
http://jimpix.co.uk/clients/a/ecards/defaultx.asp
Click on any of the links on the right under the 'occassions' or 'others' headings, in Firefox, and thumbnails appear based on what you clicked on.
Do the same in IE6, and it returns an error:
Line: 71
Char: 9
Error: Unknown runtime error
|
by: mike57 |
last post by:
The minimal AJAX script below works in Firefox, but not in IE, Opera, or Chrome. I could use some suggestions or referrals to resources that will help me get the script working in other browsers.
Before there are six characters entered in the CAPTCHA code field, the 'Send' button is supposed to be disabled. When there are at least six characters in the CAPTCHA code field, the script attempts to verify the CAPTCHA w/AJAX. If it verifies, it...
|
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,...
|
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...
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
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
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| | |