Click to See Complete Forum and Search --> : echo Ext_Record_count (record count Number) into Javascript function


joelo
08-30-2003, 10:22 AM
Please anybody help out on how to echo Ext_Record_count (record count Number) into the below function from the form

I keep get the following error

A Runtime Error has Occurred

Line 33:

Syntax Error


Line 33:

for (num=0; num< <%=Ext_Record_Count%>; num++) {


Please could anybody help me out I am confused


function calculation() {
for (num=0; num< <%=Ext_Record_Count%>; num++) {
if( !x_LowOperatingRange.value || x_LowOperatingRange.value=="NA" || (document.getElementById('PRE_DEVICEID_'+num).value.match("PSH")) && x_HighOperatingRange.value <= 30) {

document.getElementById('PRE_SetPointPressure_'+num).value + 5;
}
else if(document.getElementById('PRE_DEVICEID_'+num).value.match("PSH")) && Math.floor(x_HighOperatingRange.value) * 115/100) > x_MAWP.value * 0.95) {
document.getElementById('PRE_SetPointPressure_'+num).value = x_MAWP.value * 0.95;
}
else if(document.getElementById('PRE_DEVICEID_'+num).value.match("PSH")) {
document.getElementById(PRE_SetPointPressure_.value = Math.floor(x_HighOperatingRange.value)) * 115/100);
}
if( !x_LowOperatingRange.value || x_LowOperatingRange.value=="NA" || (document.getElementById('PRE_DEVICEID_'+num).value.match("PAH")) && Math.floor(x_HighOperatingRange.value)*107.5/100) > (0.95 * x_MAWP.value)) {

document.getElementById('PRE_SetPointPressure_'+num).value = x_MAWP.value * 0.95;
}
else if(document.getElementById('PRE_DEVICEID_'+num).value.match("PAH")) {
document.getElementById('PRE_SetPointPressure_'+num).value = Math.floor(x_HighOperatingRange.value)*107.5/100);
}
if( !x_HighOperatingRange.value || x_HighOperatingRange.value=="NA" || (document.getElementById('PRE_DEVICEID_'+num).value.match("PSL")) && x_LowOperatingRange.value <= 30) {

document.getElementById('PRE_SetPointPressure_'+num).value = x_LowOperatingRange.value - 5;
}
else if(document.getElementById('PRE_DEVICEID_'+num).value.match("PSL")) && x_LowOperatingRange.value >= 31) {
document.getElementById('PRE_SetPointPressure_'+num).value = Math.ceil(x_LowOperatingRange.value)*85/100);
}
if( !x_HighOperatingRange.value || x_HighOperatingRange.value=="NA" || (document.getElementById('PRE_DEVICEID_'+num).value.match("PAL"))) {
document.getElementById('PRE_SetPointPressure_'+num).value = Math.ceil(x_LowOperatingRange.value)*92.5/100);
}
}

}

This is the form
*************
<tr id="trow_<%=Ext_Record_Count%>" name="ntrow_<%=Ext_Record_Count%>">
<td class="data" height="58" bgcolor="#F5F5F5"> <input type="text" id="PRE_idDEVICEID_<%=Ext_Record_Count%>" name="PRE_DEVICEID_<%=Ext_Record_Count%>" value="<%=trim(Rs_Ext("DEVICEID")) %>" size=15 maxlength=10>
</td>
<td class="data" bgcolor="#F5F5F5"> <input type="text" id="PRE_idSETPOINTPRESSURE_<%=Ext_Record_Count%>" name="PRE_SETPOINTPRESSURE_<%=Ext_Record_Count%>" value="<%=trim(Rs_Ext("SETPOINTPRESSURE")) %>"size=6 maxlength=8>
</td>
<td class="data" bgcolor="#F5F5F5"> <input type="text" id="PRE_idFOUNDPRESSURE_<%=Ext_Record_Count%>" name="PRE_FOUNDPRESSURE_<%=Ext_Record_Count%>" value="<%=trim(Rs_Ext("FOUNDPRESSURE")) %>" size=6 maxlength=8>
</td>
<td class="data" bgcolor="#F5F5F5"> <input type="text" id="PRE_idLEFTPRESSURE_" name="PRE_LEFTPRESSURE_<%=Ext_Record_Count%>" value="<%=trim(Rs_Ext("LEFTPRESSURE")) %>" size=6 maxlength=8 onBlur="CyJS_Utils_isNumber(this);">
</td>