File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Problem related to browsers and javascript 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 "Problem related to browsers and javascript" Watch "Problem related to browsers and javascript" New topic
Author

Problem related to browsers and javascript

Ajay Soni
Greenhorn

Joined: May 24, 2006
Posts: 8
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.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61766
    
  67

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.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
And what does the call to this function custom(arg,arg1) look like?

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem related to browsers and javascript