code working in internet explorer but not in mozilla and iam getting erroe like window.event has no properties and here is the code
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@taglib uri="/tags/struts-html" prefix="html" %>
<%@taglib uri="/tags/struts-bean" prefix="bean" %>
<%@taglib uri="/tags/struts-logic" prefix="logic" %>
<html:html>
<HEAD>
<logic:present name="AdministratorForm">
<TITLE>Edit User Registration Details</TITLE>
</logic:present>
<logic:notPresent name="AdministratorForm">
<TITLE>User Registration</TITLE>
</logic:notPresent>
<LINK href="<html:rewrite page='/styles/RTStyles.css'/> type="text/css" rel="stylesheet">
<script language="JavaScript" src="<html:rewrite page='/javascript/calendar.js'/>"></script>
<script language="JavaScript" src="<html:rewrite page='/javascript/rtmenu.js'/>"></script>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.3790.2759" name=GENERATOR>
<script>
function selectAction(action){
document.forms[0].action=action;
if(validateUserReg()){
document.forms[0].submit();
}
}
</script>
<script>
function userGroupChange(change)
{
if(document.getElementsByName("userGroupId")[0].value=='1')
{
document.getElementsByName("isAdmin")[0].checked=true
document.getElementsByName("isAdmin")[0].disabled=true
document.getElementsByName("isAdmin")[1].value=true
}
if(document.getElementsByName("userGroupId")[0].value=='2')
{
document.getElementsByName("isAdmin")[0].checked=false
document.getElementsByName("isAdmin")[0].disabled=false
document.getElementsByName("isAdmin")[1].value=false
}
if(document.getElementsByName("userGroupId")[0].value=='3')
{
document.getElementsByName("isAdmin")[0].checked=false
document.getElementsByName("isAdmin")[0].disabled=true
document.getElementsByName("isAdmin")[1].value=false
}
}
function userGroupChangeLoad(lchange)
{
if(document.getElementsByName("userGroupId")[0].value=='1')
{
document.getElementsByName("isAdmin")[0].checked=true
document.getElementsByName("isAdmin")[0].disabled=true
document.getElementsByName("isAdmin")[1].value=true
}
if(document.getElementsByName("userGroupId")[0].value=='2')
{
document.getElementsByName("isAdmin")[1].value=false
}
if(document.getElementsByName("userGroupId")[0].value=='3')
{
document.getElementsByName("isAdmin")[0].checked=false
document.getElementsByName("isAdmin")[0].disabled=true
document.getElementsByName("isAdmin")[1].value=false
}
}
function trimField(field)
{
field.value=field.value.replace(/^\s*|\s*$/g,"");
}
function keyPressed(evt){
var charCode = (evt.which) ? evt.which : window.event.keyCode
if(charCode==13 ){
selectAction('<html:rewrite page="/registeruser.do?activity=userInfo"/>')
}
if(window.event.keyCode==13 ){
selectAction('<html:rewrite page="/registeruser.do?activity=userInfo"/>')
}
}
</script>
</HEAD>
<body onkeypress="keyPressed(event)" onLoad="userGroupChangeLoad(this)">
<div align="center">
<table width="774" height="22" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td align="left" valign="top"><table width="774" border="0" align="center" cellpadding="0" cellspacing="8" bordercolor="#333333">
<tr>
<td align="left" valign="top" style="border:#666666 1px solid">
<html:form action="/registeruser.do" focus="firstName" enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<logic:notPresent name="AdministratorForm">
<td align="left" colspan="2" valign="middle" bgcolor="#b5b4bf" style="border:#FFFFFF 1px solid" class="style10">User Registration</td>
</logic:notPresent>
<logic:present name="AdministratorForm">
<td align="left" colspan="2" valign="middle" bgcolor="#b5b4bf" style="border:#FFFFFF 1px solid" class="style10">Edit User Registration</td>
</logic:present>
</tr>
<tr><td width="5%">
</td></tr>
<tr><td align="left" class="main_note"><a class="rtstar">*</a> <bean:message key="userRegistration.mandatoryMsg" /></td></tr>
<tr><td align="left" class="main_note"> </td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="21%" align="right" valign="middle">
<logic:messagesPresent message="true" >
<span class="error_msg"><html:messages id="error" message="true" property="userExists">
<bean:write name="error" /></html:messages>
</span></logic:messagesPresent></td></tr>
<tr><td> </td></tr>
<tr>
<logic:messagesPresent message="true" property="firstName">
<td width="20%" height="22" align="right" valign="middle"
class="field_labelError"><bean:message
key="userRegistration.label.firstName" /><a class="rtstar">*</a>
</td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="firstName">
<td width="20%" height="22" align="right" valign="middle"
class="field_label"><bean:message
key="userRegistration.label.firstName" /><a class="rtstar">*</a>
</td>
</logic:messagesNotPresent>
<td width="16%" align="left" valign="middle" class="field_txt"><html:text
property="firstName" styleClass="tableMainInput" maxlength="50"
tabindex="1" size="23" onblur="trimField(this)" />
</td>
<td width="12%"></td>
<logic:messagesPresent message="true" property="userGroupId">
<td width="19%" align="right" height="22" valign="middle"
class="field_labelError"><bean:message
key="userRegistration.label.userGroup" /><a class="rtstar">*</a>
</td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="userGroupId">
<td width="19%" align="right" height="22" valign="middle"
class="field_label"><bean:message
key="userRegistration.label.userGroup" /><a class="rtstar">*</a>
</td>
</logic:messagesNotPresent>
<td width="33%" align="left" valign="middle" class="field_txt">
<html:select property="userGroupId" onchange="userGroupChange(this)" style="width:145px" styleClass="tableMainInput" tabindex="7" >
<html:option value="">------------Select------------</html:option>
<html:options property="key" collection="userGroup"
labelProperty="value" />
</html:select>
</td>
</tr>
<tr><td height="22" align="right" valign="middle" class="field_label"><bean:message
key="userRegistration.label.middleName" />
</td>
<td align="left" valign="top" class="field_txt"><html:text
property="middleName" styleClass="tableMainInput" maxlength="50"
tabindex="2" size="23" onblur="trimField(this)" />
</td>
<td></td>
<td align="right" height="22" valign="middle" class="field_label"><bean:message key="userRegistration.label.admin" />
</td>
<td align="left" valign="middle"><html:checkbox property="isAdmin" tabindex="8" /><html:hidden property="isAdmin"/>
</td>
</tr>
<tr>
<logic:messagesPresent message="true" property="lastName">
<td height="22" align="right" valign="middle" class="field_labelError"><bean:message key="userRegistration.label.lastName" /><a class="rtstar">*</a></td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="lastName">
<td align="right" height="22" valign="middle" class="field_label"><bean:message key="userRegistration.label.lastName" /><a class="rtstar">*</a></td>
</logic:messagesNotPresent>
<td align="left" valign="top" class="field_txt"><LABEL><html:text property="lastName" styleClass="tableMainInput" maxlength="50" tabindex="3" size="23" onblur="trimField(this)"/></LABEL></td>
<td></td>
<logic:messagesPresent message="true" property="userName">
<td height="22" align="right" valign="middle"
class="field_labelError"><bean:message
key="userRegistration.label.userName" /><a class="rtstar">*</a>
</td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="userName">
<td height="22" align="right" valign="middle"
class="field_label"><bean:message
key="userRegistration.label.userName" /><a class="rtstar">*</a>
</td>
</logic:messagesNotPresent>
<td align="left" valign="top" class="field_txt"><label><html:text
property="userName" styleClass="tableMainInput" tabindex="9"
size="23" maxlength="50" onblur="trimField(this)" /></label>
</td>
</tr>
<tr>
<logic:messagesPresent message="true" property="phoneNumber">
<td align="right" height="22" valign="middle" class="field_labelError"><bean:message key="userRegistration.label.phone" /><a class="rtstar">*</a></td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="phoneNumber">
<td align="right" height="22" valign="middle" class="field_label"><bean:message key="userRegistration.label.phone" /><a class="rtstar">*</a></td>
</logic:messagesNotPresent>
<td align="left" valign="top" class="field_txt"><label><html:text property="phoneNumber" onkeypress="return isPhoneKey(event);" styleClass="tableMainInput" maxlength="15" tabindex="4" size="23" onblur="trimField(this)"/></label></td>
<td></td>
<logic:messagesPresent message="true" property="userPassword">
<td align="right" height="22" valign="middle" class="field_labelError"><bean:message key="userRegistration.label.password" /><a class="rtstar">*</a></td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="userPassword">
<td align="right" height="22" valign="middle" class="field_label"><bean:message key="userRegistration.label.password" /><a class="rtstar">*</a></td>
</logic:messagesNotPresent>
<td align="left" valign="top" class="field_txt"><label><html:password property="userPassword" styleClass="tableMainInput" tabindex="10" size="23" maxlength="50" onblur="trimField(this)"/></label></td>
</tr>
<tr>
<logic:messagesPresent message="true" property="email">
<td align="right" height="22" id="emailErrmsg" valign="middle" class="field_labelError"> <bean:message key="userRegistration.label.email" /><a class="rtstar">*</a></td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="email">
<td align="right" id="emailErrmsg" height="22" valign="middle" class="field_label"> <bean:message key="userRegistration.label.email" /><a class="rtstar">*</a></td>
</logic:messagesNotPresent>
<td align="left" valign="middle" class="field_txt" >
<html:text property="email" onblur="validate(this.value);" styleId="em" styleClass="tableMainInput" maxlength="50" tabindex="5" size="23" /></td>
<td><span id="el" class="invalid_msgError" /></td>
<logic:messagesPresent message="true" property="reTypePassword">
<td align="right" height="22" valign="middle" class="field_labelError"><bean:message key="userRegistration.label.re-TypePassword" /><a class="rtstar">*</a><span id="reTypeErrmsg" /></td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="reTypePassword">
<td align="right" height="22" valign="middle" width="16%" class="field_label"><bean:message key="userRegistration.label.re-TypePassword" /><a class="rtstar">*</a><span id="reTypeErrmsg" /></td>
</logic:messagesNotPresent>
<td align="left" valign="middle" class="field_txt" ><html:password property="reTypePassword" styleClass="tableMainInput" onfocus="overlayclose('reTypePwdError'); return false" onblur="reTypePasswordCheck(userPassword,this);" tabindex="11" size="23" maxlength="50" /> </td>
</tr>
<tr>
<logic:messagesPresent message="true" property="fax">
<td align="right" height="22" valign="middle" class="field_labelError"><bean:message key="userRegistration.label.fax" /> </td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="fax">
<td align="right" height="22" valign="middle" class="field_label"><bean:message key="userRegistration.label.fax" /> </td>
</logic:messagesNotPresent>
<td align="left" valign="middle" class="field_txt"><label><html:text property="fax" onkeypress="return isPhoneKey(event);" styleClass="tableMainInput" tabindex="6" size="23" onblur="trimField(this)" maxlength="15" /></label></td>
<td></td>
<logic:messagesPresent message="true" property="securityQuestionId">
<td align="right" height="22" valign="top" class="field_labelError"><bean:message key="userRegistration.label.securityQuestion" /><a class="rtstar">*</a></td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="securityQuestionId">
<td align="right" height="22" valign="middle" class="field_label"><bean:message key="userRegistration.label.securityQuestion" /><a class="rtstar">*</a></td>
</logic:messagesNotPresent>
<td align="left" valign="top" class="field_txt">
<html:select property="securityQuestionId" styleClass="tableMainInput" tabindex="12" style="width:145px" >
<html:option value="">--------Select--------</html:option>
<html:options property="key" collection="securityQuestions" labelProperty="value"/>
</html:select></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td></td>
<logic:messagesPresent message="true" property="securityAnswer">
<td align="right" height="22" valign="middle" class="field_labelError"><bean:message key="userRegistration.label.securityAnswer" /><a class="rtstar">*</a></td>
</logic:messagesPresent>
<logic:messagesNotPresent message="true" property="securityAnswer">
<td align="right" height="22" valign="middle" class="field_label"><bean:message key="userRegistration.label.securityAnswer" /><a class="rtstar">*</a></td>
</logic:messagesNotPresent>
<td align="left" valign="middle" class="field_txt"><label><html:text property="securityAnswer" styleClass="tableMainInput" tabindex="13" maxlength="50" size="23" onblur="trimField(this)"/></label></td>
<tr><td colspan="4"> </td></tr>
<tr>
<td > </td>
<td > </td>
<logic:present name="AdministratorForm">
<td colspan="2" align="left" valign="middle" style="padding-right:20px"><a tabindex="14" onClick="selectAction('<html:rewrite page="/registeruser.do?activity=userSaveChanges"/>')"><img src="<html:rewrite page="/images/update.gif"/>" border="0" /></a>
<a tabindex="15" onClick="selectAction('<html:rewrite page="/registeruser.do?activity=userDiscardChanges"/>')"><img src="<html:rewrite page="/images/cancelbut.gif"/>" border="0" /></a>
</td>
</logic:present>
<logic:notPresent name="AdministratorForm">
<td colspan="4" align="right" valign="middle" style="padding-right:90px" ><a tabindex="14" onClick="selectAction('<html:rewrite page="/registeruser.do?activity=userInfo"/>')"><img src="<html:rewrite page="/images/next.gif"/>" border="0" /></a>
</td>
</logic:notPresent>
</tr></table>
</html:form></table></td></tr></table></div></body>
<script language="JavaScript" src="<html:rewrite page='/javascript/validations.js'/>"></script>
</html:html>
<DIV id="reTypePwdError" style="position:absolute; display:none; border: 2px solid black; background-color: #e3e3e3; width: 145px; height:auto; padding:5px;vertical-align:top;color:#FF0000;" class="field_txt"></div>
</DIV>