This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes A function working in IE but not in Crome/Firefox 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 "A function working in IE but not in Crome/Firefox" Watch "A function working in IE but not in Crome/Firefox" New topic
Author

A function working in IE but not in Crome/Firefox

sahithi mohan
Greenhorn

Joined: Feb 13, 2012
Posts: 9
<INPUT class="btn" onmouseover="this.className='btn btnhov'"
onmouseout="this.className='btn'" type=button value="Save" id=submit2 name=submit2
onClick="save()">



function save()
{

if(document.getElementById("selectedName.nameId").value == -1) {
alert("please select a name to save");
} else {
document.saveForm.action="save.action";
document.saveForm.submit();
}


}
Can some one help me, What are the changes i need to made to work with the Chrome or Firefox?
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

I have no idea, but firebug is very useful, may help you workout stuff.
J. Kevin Robbins
Bartender

Joined: Dec 16, 2010
Posts: 983
    
  13

It's been my experience that it's usually the other way around. Works in Firefox, not IE. As Wendy said, you need Firebug to see what error message is showing up in the Javascript console.


"The good news about computers is that they do what you tell them to do. The bad news is that they do what you tell them to do." -- Ted Nelson
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: A function working in IE but not in Crome/Firefox