Hello,
Thanks to all your help I have been writing some neat scripts. Thank you!!!
I am stuck with a script that works well with one line but if I bring dynamic data it does not work at all and not sure what the problem might be.
I am using my javascript in an asp page.
I have a drop down box and depending on the value of the drop down box my other field should change here is the code that I have
This shows all records for item 0025. if I take the Recordset1.MoveNext() Wed and only show one record it works fine
any idea why???
Thanks!!
Thanks to all your help I have been writing some neat scripts. Thank you!!!
I am stuck with a script that works well with one line but if I bring dynamic data it does not work at all and not sure what the problem might be.
I am using my javascript in an asp page.
I have a drop down box and depending on the value of the drop down box my other field should change here is the code that I have
Code:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!--#include file="Connections/pricdsn.asp" -->
<%
Dim Recordset1
Dim Recordset1_numRows
Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_pricdsn_STRING
Recordset1.Source = "SELECT * FROM AMFLIB.MBCWCPP where cwfvnb = 1090101 and cwaitx='0025'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript">
function startCalc4(){
interval = setInterval("calc4()",1);
}
function calc4(){
one = document.form1.prcbook.value;
two = document.form1.percent.value;
document.form1.total.value = (one * 1) * (two * 1);
}
function stopCalc4(){
clearInterval(interval);
}
</script>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
left:26px;
top:49px;
width:150px;
height:24px;
z-index:1;
}
#Layer2 {
position:absolute;
left:36px;
top:22px;
width:166px;
height:22px;
z-index:2;
}
#Layer3 {
position:absolute;
left:19px;
top:24px;
width:174px;
height:21px;
z-index:3;
}
-->
</style>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<p>
</p>
<p> </p>
<p>
<input type="text" name="itm" value="<%=(Recordset1.Fields.Item("CWAITX").Value)%>" />
</p>
<table border="1">
<tr>
<td>CWFVNB</td>
<td>CWAENB</td>
<td>CWBRCD</td>
</tr>
<% While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF)) %>
<td>
<input type="text" name="qty" value="<%=(Recordset1.Fields.Item("CWAJQT").Value)%>"/></td>
<td><input name="prcbook" type="text" value="<%=(Recordset1.Fields.Item("CWKDVA").Value)%>" onFocus="startCalc4();"
onBlur="stopCalc4();" /></td>
<td><input type="text" name="total" value=""/></td>
<td><select name="percent">
<option value="0"onFocus="startCalc4();"
onBlur="stopCalc4();">select</option>
<option value="1.10onFocus="startCalc4();"
onBlur="stopCalc4();">10%</option>
<option value="1.25onFocus="startCalc4();"
onBlur="stopCalc4();">25%</option>
</select></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
</form>
</body>
</html>
any idea why???
Thanks!!