GOGREEN PC TUNEUP
Learn More


Insta-Install

myBlog

myBlog Home

Back to Blog MTNCOMP


Cut to Size, Custom, ASP, Javascript

Published: Saturday, February 23, 2019 written by Drew Jackson
View Count: 100
Keywords: Cut to Size, Custom, ASP, Javascript



hello Javascript programmers,
 
in the previous article and post, the cut to size shape is different than full sheet in javascript is where the hard work came in.. the actual database entries for pricing for full versus cut sheet was the trigger to determine price per square feet, either by cut to size versus full sheet... here is the math
 
 
 
  < % if sheet_style = "full_sheet" then % >
    <input type="text" size="3" name="subproduct_quantity" value="0" OnChange="var myval; myval = (32 * document.subproduct< %=rs("subproduct_id")% >.subproduct_price.value) * document.subproduct< %=rs("subproduct_id")% >.subproduct_quantity.value; myval = Math.round(myval * 100) / 100; document.subproduct< %=rs("subproduct_id")% >.subproduct_extendedprice.value = '$' + myval.toFixed(2) ;">
    < % end if % >
    < % if sheet_style = "cut_to_size" then % >
    <input type="hidden" name="cut_to_size_length" size="3" value="0"><input type="hidden" name="cut_to_size_width" size="3" value="0">
    <input type="text" size="3" name="subproduct_quantity" value="0" OnChange="document.subproduct< %=rs("subproduct_id")% >.cut_to_size_length.value=document.cut_to_size_values.length.value;document.subproduct< %=rs("subproduct_id")% >.cut_to_size_width.value=document.cut_to_size_values.width.value;var myval; myval = (((document.cut_to_size_values.length.value * document.cut_to_size_values.width.value) / 144 )* document.subproduct< %=rs("subproduct_id")% >.subproduct_price.value) * document.subproduct< %=rs("subproduct_id")% >.subproduct_quantity.value; myval = Math.round(myval * 100) / 100; document.subproduct< %=rs("subproduct_id")% >.subproduct_extendedprice.value = '$' + myval.toFixed(2) ;">
    < % end if % >
 
 
https://www.mountaincomputers.org/myBlog/myBlog.asp?mode=view&id=316
 
more to come...

if you found this article helpful, consider contributing $10, 20 or so..to the author. more authors coming soon
FYI we use paypal or patreon, patreon has 3x the transaction fees, so we don't, not yet.

© 2019 myBlog™ v1.1 All rights reserved. We count views as reads, so let's not over think it.