Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Javascript working on firefox but not on IE

 
Gaurav Pawar
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
?? What is the browser complaining about ?
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gaurav Pawar:

Please suggest what the problem could be.


Problem where!
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Gaurav Pawar:




change you method "value" with "text"



and its working fine on both browser..
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.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
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah changing to .text worked.
Thanks a lot.
 
Muhammad Saifuddin
Ranch Hand
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic