Calculation .................Help me!!!

  • Joelo
  • Born
  • Born
  • Joelo
  • Posts: 1

Post 3+ Months Ago

Please anybody help out on how to echo Ext_Record_count (record count Number) into the below function from 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);
}
}

}
  1. function calculation() {
  2. for (num=0; num< <%=Ext_Record_Count%>; num++) {
  3. if( !x_LowOperatingRange.value || x_LowOperatingRange.value=="NA" || (document.getElementById('PRE_DEVICEID_'+num).value.match("PSH")) && x_HighOperatingRange.value <= 30) {
  4. document.getElementById('PRE_SetPointPressure_'+num).value + 5;
  5. }
  6. else if(document.getElementById('PRE_DEVICEID_'+num).value.match("PSH")) && Math.floor(x_HighOperatingRange.value) * 115/100) > x_MAWP.value * 0.95) {
  7. document.getElementById('PRE_SetPointPressure_'+num).value = x_MAWP.value * 0.95;
  8. }
  9. else if(document.getElementById('PRE_DEVICEID_'+num).value.match("PSH")) {
  10. document.getElementById(PRE_SetPointPressure_.value = Math.floor(x_HighOperatingRange.value)) * 115/100);
  11. }
  12. 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)) {
  13. document.getElementById('PRE_SetPointPressure_'+num).value = x_MAWP.value * 0.95;
  14. }
  15. else if(document.getElementById('PRE_DEVICEID_'+num).value.match("PAH")) {
  16. document.getElementById('PRE_SetPointPressure_'+num).value = Math.floor(x_HighOperatingRange.value)*107.5/100);
  17. }
  18. if( !x_HighOperatingRange.value || x_HighOperatingRange.value=="NA" || (document.getElementById('PRE_DEVICEID_'+num).value.match("PSL")) && x_LowOperatingRange.value <= 30) {
  19. document.getElementById('PRE_SetPointPressure_'+num).value = x_LowOperatingRange.value - 5;
  20. }
  21. else if(document.getElementById('PRE_DEVICEID_'+num).value.match("PSL")) && x_LowOperatingRange.value >= 31) {
  22. document.getElementById('PRE_SetPointPressure_'+num).value = Math.ceil(x_LowOperatingRange.value)*85/100);
  23. }
  24. if( !x_HighOperatingRange.value || x_HighOperatingRange.value=="NA" || (document.getElementById('PRE_DEVICEID_'+num).value.match("PAL"))) {
  25. document.getElementById('PRE_SetPointPressure_'+num).value = Math.ceil(x_LowOperatingRange.value)*92.5/100);
  26. }
  27. }
  28. }


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>
  1. <tr id="trow_<%=Ext_Record_Count%>" name="ntrow_<%=Ext_Record_Count%>">
  2. <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>
  3. </td>
  4. <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>
  5. </td>
  6. <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>
  7. </td>
  8. <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);">
  9. </td>
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9091
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

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

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 52 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.