Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getElementById is not a function error in FF

Status
Not open for further replies.

JRye

Technical User
Nov 14, 2008
8
US
This is driving me nuts. This script executes fine in IE, but in FF I get this error "document.getElementById(buttonID2).fireEvent is not a function". When I remove the underscores from the submitButton id's I don't get any error messages, but then it doesn't work in IE or FF. Is it the .fireEvent in FF, should I use dispatchEvent?

<script language="javascript">
// disable button and submit form
if(document.getElementById("submitButton2_")){
var buttonId2=document.getElementById("submitButton2_").title;
document.getElementById(buttonId2).fireEvent("onclick");
}

if(document.getElementById("submitButton1_")){
var buttonId2=document.getElementById("submitButton1_").title;
document.getElementById(buttonId2).fireEvent("onclick");

}

</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top