Click to See Complete Forum and Search --> : Netscape 6 is not too smart.....
mawood
05-06-2003, 01:05 PM
Ok, N6 is giving a (hopefully) simple issue. If I have more than one field with the same name, N6 seems to lack the ability to edit those fields through the following approach:
for (i=0; i < numb; i++) {
document.ProcedureInfo.startday[i].value = NowDay;
document.ProcedureInfo.startmonth[i].value = NowMonth;
document.ProcedureInfo.startyear[i].value = NowYear;
document.ProcedureInfo.endday[i].value = NowDay;
document.ProcedureInfo.endmonth[i].value = NowMonth;
document.ProcedureInfo.endyear[i].value = NowYear;
}
This function is to apply todays date to a series of dynamically generated date fields. It works fine in IE and in Netscape 7. Is there another approach that can be used in N6 to make it understand where to apply the values?
Below is the source code of my jsp in two parts:
mawood
05-06-2003, 01:06 PM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
<title>Procedure Information</title>
<script SRC="https://www.oxhp.com/js/oxhp.js" LANGUAGE="JavaScript"></SCRIPT>
<script LANGUAGE="JavaScript">
function writeToLayerDate(lay,txt,numb) {
var txtt = '';
var txttt = '';
if (numb != '') { // Check if this multiple
for (i=0; i < numb; i++) {
txtt = txtt + txt;
txttt = txtt;
}
} else {
txttt = txt;
}
if (document.all) { // For IE4+
document.all[lay].innerHTML = txttt;
} else { // For NS6+
over = document.getElementById([lay]);
range = document.createRange();
range.setStartBefore(over);
domfrag = range.createContextualFragment(txttt);
while (over.hasChildNodes()) {
over.removeChild(over.lastChild);
}
over.appendChild(domfrag);
}
var Now = new Date();
var NowDay = Now.getDate();
var NowMonth = Now.getMonth() + 1;
var NowYear = Now.getYear();
if (NowYear < 2000) NowYear += 1900; //for Netscape
if (NowDay < 10) NowDay = '0' + NowDay;
if (NowMonth < 10) NowMonth = '0' + NowMonth;
if(numb != '' && numb > 1) {
for (i=0; i < numb; i++) {
document.ProcedureInfo.startday[i].value = NowDay;
document.ProcedureInfo.startmonth[i].value = NowMonth;
document.ProcedureInfo.startyear[i].value = NowYear;
document.ProcedureInfo.endday[i].value = NowDay;
document.ProcedureInfo.endmonth[i].value = NowMonth;
document.ProcedureInfo.endyear[i].value = NowYear;
} //end for
}
else if (numb == '1') {
document.ProcedureInfo.startday.value = NowDay;
document.ProcedureInfo.startmonth.value = NowMonth;
document.ProcedureInfo.startyear.value = NowYear;
document.ProcedureInfo.endday.value = NowDay;
document.ProcedureInfo.endmonth.value = NowMonth;
document.ProcedureInfo.endyear.value = NowYear;
}
}
// Matching to date when from is chosen
function checkIT(fld,grp2) {
fld.findME = true;
var grp1 = fld.form.elements[fld.name];
var j, len = grp1.length;
for (j=0; j<len; j++) {
if (grp1[j].findME) break;
}
fld.findME = false;
if (grp2[j] == null) {
grp2.value = grp1.value;
} else {
grp2[j].value = grp1[j].value;
}
return true;
}
function padout(number) { return (number < 10) ? '0' + number : number; }
function y2k(number) { return (number < 1000) ? number + 1900 : number; }
function validate(what) {
var marksNum = document.ProcedureInfo.numCode.options[document.ProcedureInfo.numCode.selectedIndex].value;
var marksFNum = marksNum -0;
var marksFinalNum = (marksNum - 1);
for (i=0; i < marksFNum; i++) {
var startday = document.ProcedureInfo.startday[i].options[document.ProcedureInfo.startday[i].selectedIndex].value;
var startmonth = document.ProcedureInfo.startmonth[i].options[document.ProcedureInfo.startmonth[i].selectedIndex].value;
var startyear = document.ProcedureInfo.startyear[i].options[document.ProcedureInfo.startyear[i].selectedIndex].text;
var endday = document.ProcedureInfo.endday[i].options[document.ProcedureInfo.endday[i].selectedIndex].value;
var endmonth = document.ProcedureInfo.endmonth[i].options[document.ProcedureInfo.endmonth[i].selectedIndex].value;
var endyear = document.ProcedureInfo.endyear[i].options[document.ProcedureInfo.endyear[i].selectedIndex].text;
unvalidstartdate = startday + '/' + startmonth + '/' + startyear;
unvalidenddate = endday + '/' + endmonth + '/' + endyear;
var startdate = new Date(startyear-0,startmonth-1,startday-0);
var enddate = new Date(endyear-0,endmonth-1,endday-0);
var validstartdate = padout(startdate.getDate()) + '/' + padout(startdate.getMonth()+1) + '/' + y2k(startdate.getYear())
var validenddate = padout(enddate.getDate()) + '/' + padout(enddate.getMonth()+1) + '/' + y2k(enddate.getYear())
if (unvalidstartdate != validstartdate) {
alert('Start Date: ' + document.ProcedureInfo.startday[i].options[document.ProcedureInfo.startday[i].selectedIndex].text +
' ' + document.ProcedureInfo.startmonth[i].options[document.ProcedureInfo.startmonth[i].selectedIndex].text +
' ' + document.ProcedureInfo.startyear[i].options[document.ProcedureInfo.startyear[i].selectedIndex].text + ' is invalid');
return false;
}
if (unvalidenddate != validenddate) {
alert('End Date: ' + document.ProcedureInfo.endday[i].options[document.ProcedureInfo.endday[i].selectedIndex].text +
' ' + document.ProcedureInfo.endmonth[i].options[document.ProcedureInfo.endmonth[i].selectedIndex].text +
' ' + document.ProcedureInfo.endyear[i].options[document.ProcedureInfo.endyear[i].selectedIndex].text + ' is invalid');
return false;
}
starttime = Date.UTC(y2k(startdate.getYear()),startdate.getMonth(),startdate.getDate(),0,0,0);
endtime = Date.UTC(y2k(enddate.getYear()),enddate.getMonth(),enddate.getDate(),0,0,0);
if (starttime < endtime) {
// valid
}
else {
alert('A Start Date is not less than End Date');
return false
}
var theDates = startyear + startmonth + startday + "-" + endyear + endmonth + endday ;
document.ProcedureInfo.CPTR_PROC_CODE_DATE[i].value = theDates;
}
return true;
}
function getQuery(btvalue) {
var frm = document.ProcedureInfo;
var action;
var codes;
if (frm.codesList != null) {
codes = frm.codesList.options[frm.codesList.selectedIndex].value;
}
if (btvalue == "ENTER") {
if ( codes != null && codes == "Yes" ) {
document.ProcedureInfo.action="/baadmin/RoutingServlet?AppName=PRECERT_SUBMISSION&UserAction=ProcedureConfirm&addlDocFlag=No";
document.ProcedureInfo.submit();
} else {
document.ProcedureInfo.action="/baadmin/RoutingServlet?AppName=PRECERT_SUBMISSION&UserAction=ServiceLevel2Info&";
document.ProcedureInfo.submit();
}
} else {
document.ProcedureInfo.action="/baadmin/RoutingServlet?AppName=PRECERT_SUBMISSION&UserAction=ProcedureInfo&";
document.ProcedureInfo.submit();
}
}
</script>
</head>
mawood
05-06-2003, 01:07 PM
<body bgcolor="white" onload="document.ProcedureInfo.codesList.focus();">
<table border="0" width="550"><tr><td><font face="arial,helvetica" size="2"><h2><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">Procedure Information</font></h2>
<form name="ProcedureInfo" onsubmit="return getQuery('ENTER');" method="POST">
<input type=hidden name="sourceAction" value="ProcedureConfirm"><input type=hidden name="conditionInfo" value="null"><input type=hidden name="mode" value="INFO">
<table border="0" cellpadding="2" cellspacing="2" width="550">
<tr>
<td bgcolor="#eeeeee" >
<div align="right">
<b><font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" color="#003366">Do you have procedure or service codes for this request?</b></font></div>
</td>
<td bgcolor="#a6b7c9"><font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><select size="1" name="codesList">
<option value="Yes">Yes
<option value="No">No
</select>
</td></tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td bgcolor="#eeeeee">
<div align="right">
<font size="2" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" color="#003366"><b>How many codes do you have for this procedure?</b>
</font>
</td>
<td bgcolor="#a6b7c9"><font size="2" face="arial,helvetica"><select name="numCode" size="1" onchange="if (this.options[this.selectedIndex].value != '0') javascript:writeToLayerDate('newlayer5','<table border=\'0\' cellpadding=\'2\' cellspacing=\'2\' width=\'550\'><tr><td bgcolor=\'#eeeeee\' nowrap><div align=\'right\'><b><font size=\'2\' face=\'Arial,Helvetica,Geneva,Swiss,SunSans-Regular\' color=\'red\'>* </b></font><font size=\'2\' face=\'Arial,Helvetica,Geneva,Swiss,SunSans-Regular\' color=\'#003366\'><select name=\'CPTR_CODE_LIST_QUAL\' size=\'1\'><option value=\'BO\'>HCFA<option value=\'BQ\'>ICD-9-CM Procedure</select></font></td><td bgcolor=\'#a6b7c9\'><font size=\'2\' face=\'arial,helvetica\'><input type=\'text\' name=\'CPTR_PROC_CODE\' size=\'24\' maxlength=\'30\' ></td></tr><tr><td bgcolor=\'#eeeeee\' nowrap><div align=\'right\'><font size=\'2\' face=\'Arial,Helvetica,Geneva,Swiss,SunSans-Regular\' color=\'#003366\'><b>Procedure Date:</b></font></div></td><td bgcolor=\'#a6b7c9\' nowrap><font size=\'2\' face=\'Arial,Helvetica,Geneva,Swiss,SunSans-Regular\'>From: <select name=\'startmonth\' size=\'1\' onchange=\'return checkIT(this,endmonth);\'><option value=\'01\'>January<option value=\'02\'>February<option value=\'03\'>March<option value=\'04\'>April<option value=\'05\'>May<option value=\'06\'>June<option value=\'07\'>July<option value=\'08\'>August<option value=\'09\'>September<option value=\'10\'>October<option value=\'11\'>November<option value=\'12\'>December</select><select name=\'startday\' size=\'1\' onchange=\'return checkIT(this,endday);\'><option value=\'\'><option value=\'01\'>1<option value=\'02\'>2<option value=\'03\'>3<option value=\'04\'>4<option value=\'05\'>5<option value=\'06\'>6<option value=\'07\'>7<option value=\'08\'>8<option value=\'09\'>9<option value=\'10\'>10<option value=\'11\'>11<option value=\'12\'>12<option value=\'13\'>13<option value=\'14\'>14<option value=\'15\'>15<option value=\'16\'>16<option value=\'17\'>17<option value=\'18\'>18<option value=\'19\'>19<option value=\'20\'>20<option value=\'21\'>21<option value=\'22\'>22<option value=\'23\'>23<option value=\'24\'>24<option value=\'25\'>25<option value=\'26\'>26<option value=\'27\'>27<option value=\'28\'>28<option value=\'29\'>29<option value=\'30\'>30<option value=\'31\'>31</select><select name=\'startyear\' size=\'1\' onchange=\'return checkIT(this,endyear);\'><option value=\'2001\'>2001<option value=\'2002\'>2002<option value=\'2003\'>2003<option value=\'2004\'>2004<option value=\'2005\'>2005<option value=\'2006\'>2006<option value=\'2007\'>2007<option value=\'2008\'>2008<option value=\'2009\'>2009<option value=\'2010\'>2010</select><br> To: <select name=\'endmonth\' size=\'1\'><option value=\'01\'>January<option value=\'02\'>February<option value=\'03\'>March<option value=\'04\'>April<option value=\'05\'>May<option value=\'06\'>June<option value=\'07\'>July<option value=\'08\'>August<option value=\'09\'>September<option value=\'10\'>October<option value=\'11\'>November<option value=\'12\'>December</select><select name=\'endday\' size=\'1\'><option value=\'01\'>1<option value=\'02\'>2<option value=\'03\'>3<option value=\'04\'>4<option value=\'05\'>5<option value=\'06\'>6<option value=\'07\'>7<option value=\'08\'>8<option value=\'09\'>9<option value=\'10\'>10<option value=\'11\'>11<option value=\'12\'>12<option value=\'13\'>13<option value=\'14\'>14<option value=\'15\'>15<option value=\'16\'>16<option value=\'17\'>17<option value=\'18\'>18<option value=\'19\'>19<option value=\'20\'>20<option value=\'21\'>21<option value=\'22\'>22<option value=\'23\'>23<option value=\'24\'>24<option value=\'25\'>25<option value=\'26\'>26<option value=\'27\'>27<option value=\'28\'>28<option value=\'29\'>29<option value=\'30\'>30<option value=\'31\'>31</select><select name=\'endyear\' size=\'1\'><option value=\'2001\'>2001<option value=\'2002\'>2002<option value=\'2003\'>2003<option value=\'2004\'>2004<option value=\'2005\'>2005<option value=\'2006\'>2006<option value=\'2007\'>2007<option value=\'2008\'>2008<option value=\'2009\'>2009<option value=\'2010\'>2010</select></font></td></tr><tr><td bgcolor=\'#eeeeee\'><div align=\'right\'><font size=\'2\' face=\'Arial,Helvetica,Geneva,Swiss,SunSans-Regular\' color=\'#003366\'><b>Procedure Quantity:</b></font></td><td bgcolor=\'#a6b7c9\'><font size=\'2\' face=\'arial,helvetica\'><input type=\'text\' name=\'CPTR_QUANTITY\' size=\'2\' maxlength=\'15\' ></font></td></tr><tr><td bgcolor=\'#eeeeee\'><div align=\'right\'><font size=\'2\' face=\'Arial,Helvetica,Geneva,Swiss,SunSans-Regular\' color=\'#003366\'><b>What version of the codes are you referring to?</b></font></td><td bgcolor=\'#a6b7c9\'><font size=\'2\' face=\'arial,helvetica\'><input type=\'text\' name=\'CPTR_VERSION_IDENTIFIER\' size=\'10\' maxlength=\'30\' value=\'\'></font></td></tr></table>',this.form.numCode.options[this.form.numCode.selectedIndex].value); else javascript:writeToLayerDate('newlayer5','','');">
<option value=0>0 <option value=1>1 <option value=2>2 <option value=3>3 <option value=4>4 <option value=5>5 <option value=6>6 <option value=7>7 <option value=8>8 <option value=9>9 <option value=10>10 <option value=11>11 <option value=12>12
</select></font>
</td></tr></table>
<script LANGUAGE="JavaScript">
document.write(getRelPosnLayerTag("newlayer5"));
</SCRIPT>
</td></tr></table>
<p><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" size="2">
<input type="submit" value="ENTER" name="submitButtonName">
<input type="button" value="CLEAR" name="clearButton" onclick='return getQuery(this.value);'>
</form>
<center>
<p><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" size="1" color="#003366">©1996-<script language="JavaScript" type="text/javascript">
var time=new Date();
var year=time.getFullYear();
document.write(year);</script>, Oxford Health Plans, Inc. </font></p>
</center>
</td></tr></tbody></table></p>
</body>
<head>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
</html>
mawood
05-06-2003, 01:10 PM
Keep in mind the part in the code:
(<td bgcolor="#a6b7c9"><font size="2" face="arial,helvetica"><select name="numCode" size="1" onchange="if (this.options[this.selectedIndex].value != '0') java script:writeToLayerDate('newlayer5','<table border='0' cellpadding='2' cellspacing='2' width='550'><tr><td bgcolor='#eeeeee' nowrap><div align......)
...is a single line. This forum creates line breaks - even if its not desired.
Any help with this will be greatly appreciated.
khalidali63
05-06-2003, 02:09 PM
In most of the cases if the code works in IE and does not in ns6+ browsers that means there is definitly something wrong with the code.
Looking at your code,which I might add, is not ver readable,you have millions lines of inline code,I bet the error is in your inline code, a comma missing,wrong syntax or could be anything.