• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem related to browsers and javascript

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I am using this code to read the option values from a select option. I am getting the reference of that select option in arg1. Its working fine with mozilla firefox but not with Internet Explorer. It gives the lenth but failing to read the arguments(Shown in bold). It gives the alert Internet Explorer 4 for IE and Netscape 5 for Mozilla firefox for the alert in line 4.

function custom(arg,arg1)
if (arg == "custom")
{

var brow=((navigator.appName) + (parseInt(navigator.appVersion)));
alert("Browser" + brow);
var length = arg1.options.length;
alert("length" + length);
var str1 = "";

for(var i = 1;i < length-1; i++ )
{
str1 = str1 + arg1.options[i].value + ";" ;
}

alert(str1);
var url = "/futopt/globalrec-ajaysoni/webapp/jsp/welcome.jsp";
url = url + "?str=" + str1;
window.open(url,'welcome','width=300,height=200');
}
}

Can any rancher help me out of this. Please Suggest as soon as possible how I can read the values of the select option for IE. I shall be thankful.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please take care to choose the correct forum for posting. This forum is for questions on JSP so this post has been moved to the Javascript forum.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And what does the call to this function custom(arg,arg1) look like?

Eric
 
reply
    Bookmark Topic Watch Topic
  • New Topic