Search Tools Links Login

Javascipt and ASP


Javascript with ASP, this function is a example, how you can mix javascript and asp. The clue is it is clientside! In example a clientside calculator and need not to post anthing to the display.

Original Author: Hohl David

Code

function recalculate() {
//Berechne mir die Ausgabe bei der Order
  totalsum = new Number();
<%
artSTMT = "SELECT * FROM article"
Set artRS = nameConn.Execute(artStmt)
while not artRS.eof
  artID = trim(artRS("artID"))
%>
  price<%=artID%> = new Number(document.orderform.price<%=artID%>.value);
  quantity<%=artID%> = new Number(document.orderform.quantity<%=artID%>.value);
  linesum<%=artID%> = new Number(quantity<%=artID%> * price<%=artID%>);
  document.orderform.sumquantity<%=artID%>.value = linesum<%=artID%>;
  //document.orderform.quantity<%=artID%>.value = quantity<%=artID%>;
  totalsum = totalsum + linesum<%=artID%>;

<%
  artRS.movenext()
wend
%>
document.orderform.sumtotal.value = totalsum
}

About this post

Posted: 2002-06-01
By: ArchiveBot
Viewed: 79 times

Categories

ASP/ HTML

Attachments

No attachments for this post


Loading Comments ...

Comments

No comments have been added for this post.

You must be logged in to make a comment.