Calculation .................Help me!!!
- Joelo
- Born


- Joined: Aug 30, 2003
- Posts: 1
- Status: Offline
Please anybody help out on how to echo Ext_Record_count (record count Number) into the below function from the form
This is the form
*************
Code: [ Select ]
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);
}
}
}
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);
}
}
}
- 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
*************
Code: [ Select ]
<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>
<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>
- <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>
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
August 30th, 2003, 7:04 am
- Bigwebmaster
- Site Admin


- Joined: Dec 20, 2002
- Posts: 8926
- Loc: Seattle, WA & Phoenix, AZ
- Status: Offline
Make sure you use the BBCode code tags when you are posting code. I put them in for you around your code so that its easier to see. If you need help using it click this link:
http://www.ozzu.com/faq.php?mode=bbcode
http://www.ozzu.com/faq.php?mode=bbcode
Ozzu Hosting - Want your website on a fast server like Ozzu?
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 2 posts
- Users browsing this forum: No registered users and 165 guests
- You cannot post new topics in this forum
- You cannot reply to topics in this forum
- You cannot edit your posts in this forum
- You cannot delete your posts in this forum
- You cannot post attachments in this forum
