aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Javascript working on firefox but not on IE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Javascript working on firefox but not on IE" Watch "Javascript working on firefox but not on IE" New topic
Author

Javascript working on firefox but not on IE

Gaurav Pawar
Ranch Hand

Joined: Sep 12, 2006
Posts: 37
Hi all,

This is the javascript. Here "FY" and "TY" are the 'id' for a select-box which has years listed in it.







Please suggest what the problem could be.

Thank you.
Gaurav.
[ April 03, 2007: Message edited by: Gaurav Pawar ]
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

?? What is the browser complaining about ?


[My Blog]
All roads lead to JavaRanch
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Originally posted by Gaurav Pawar:

Please suggest what the problem could be.


Problem where!


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Oops ! sorry i was missed your Subject Topic ?

Yeah I checked on IE but it doesn't show the alert box, which is inside the if condition..
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Originally posted by Gaurav Pawar:




change you method "value" with "text"



and its working fine on both browser..
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
.value is bringing back a string and not a number so

if(x2<x1) is doing a string comparison.

You should use parseInt() before doing the comparision.

Eric
Gaurav Pawar
Ranch Hand

Joined: Sep 12, 2006
Posts: 37
Yeah changing to .text worked.
Thanks a lot.
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Originally posted by Eric Pascarello:
.value is bringing back a string and not a number so
if(x2<x1) is doing a string comparison.
You should use parseInt() before doing the comparision.
Eric


Now its clear Thanks for you reply Eric,
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Javascript working on firefox but not on IE