IE&FF兼容性 - event, keycode, returnvalue
<SCRIPT language="javascript">
function isDigit(oEvent)
{
var e = oEvent||window.event;
var codeKeyChar = e.keyCode||e.charCode;
// clear Unit No. after postal code was changed ,By Wen Chao(NCS),Monday, October 25, 2010
clearUnitNo();
if ((codeKeyChar < 46) || (codeKeyChar > 57) && (codeKeyChar != 47))
if(window.event)
window.event.returnValue = false;
else
e.preventDefault();//for firefox
}
// clear Unit No. after postal code was changed ,By Wen Chao(NCS),Monday, October 25, 2010
function clearUnitNo()
{
document.getElementById('txtUnitNo').value="";
}
</SCRIPT>
function isDigit(oEvent)
{
var e = oEvent||window.event;
var codeKeyChar = e.keyCode||e.charCode;
// clear Unit No. after postal code was changed ,By Wen Chao(NCS),Monday, October 25, 2010
clearUnitNo();
if ((codeKeyChar < 46) || (codeKeyChar > 57) && (codeKeyChar != 47))
if(window.event)
window.event.returnValue = false;
else
e.preventDefault();//for firefox
}
// clear Unit No. after postal code was changed ,By Wen Chao(NCS),Monday, October 25, 2010
function clearUnitNo()
{
document.getElementById('txtUnitNo').value="";
}
</SCRIPT>