Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Script works correctly in Firefox, not in IE6

Reply
Thread Tools

Script works correctly in Firefox, not in IE6

 
 
Paul E. Schoen
Guest
Posts: n/a
 
      09-08-2007
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.value == "?") {
alert ("Please select Dog Sex");
Form1.DogSex.focus(); }

The control is defined in a table as follows:

<TR><TD>Sex of dog: </TD><TD> <SELECT NAME="DogSex">
<OPTION>?</Option> <OPTION>Male</Option> <OPTION>Female</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


 
Reply With Quote
 
 
 
 
Paul E. Schoen
Guest
Posts: n/a
 
      09-08-2007

"Randy Webb" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.value == "?") {
>> alert ("Please select Dog Sex");
>> Form1.DogSex.focus(); }
>>
>> The control is defined in a table as follows:
>>
>> <TR><TD>Sex of dog: </TD><TD> <SELECT NAME="DogSex">
>> <OPTION>?</Option> <OPTION>Male</Option> <OPTION>Female</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">Male
> <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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Script works with IE6 but not with IE7 Manfred Javascript 3 02-07-2007 12:28 PM
When I turn on my PC, it works, works, works. Problem! Fogar Computer Information 1 01-17-2006 12:57 AM
Script works in Mozilla but not IE6 (latest versions)? mark Javascript 1 12-06-2004 12:54 PM
After rebooting my PC works, works, works! Antivirus problem? Adriano Computer Information 1 12-15-2003 05:30 AM
Just one ie6 template that works with ie6!? Ivor O'Connor HTML 4 11-25-2003 09:16 PM



Advertisments