Thimo
10-24-2002, 03:51 AM
another question here,
how come i cannot compare like <%rs("ItemQuantity")%> with the variable i created in the script tag, i would like to use the function like MsgBox to display like "Requested Quantity too much"
like for my Addshoppingcart.asp, i manged to display all the items and the quantites available, so at this page i allow them to key in their requested quantity
form name="form1" method="post" action="AddToCart.asp" >
<table border="1" align="center">
<tr>
<th height="25">Item Code</th>
<th>ItemName</th>
<th>Quantity</th>
<th>Price</th>
<th>Request Quantity</th>
</tr>
<%Do While Not rs.EOF %>
<tr align=center>
<td><%=rs("ItemCode")%></td>
<td align=left><%=rs("ItemName")%></td>
<td><%=rs("Quantity")%> </td>
<td><%=FormatCurrency(rs("Price"))%> </td><td><input name="RQty" type="text" size="3" maxlength="3" ></td>
<tr>
<%rs.MoveNext%>
<%loop%>
</table>
the form actions to AddTocart.asp, i can't seem to use Javascript or Vbscript functions for like form validation....please advice...
like compare quantity.
<%
'setting recordset and SQL statement
If Request("Qty") > rs("ItemQuantity")
Msgbox "Quantity not enough!!"
%>
i cannto do this right?...
how come i cannot compare like <%rs("ItemQuantity")%> with the variable i created in the script tag, i would like to use the function like MsgBox to display like "Requested Quantity too much"
like for my Addshoppingcart.asp, i manged to display all the items and the quantites available, so at this page i allow them to key in their requested quantity
form name="form1" method="post" action="AddToCart.asp" >
<table border="1" align="center">
<tr>
<th height="25">Item Code</th>
<th>ItemName</th>
<th>Quantity</th>
<th>Price</th>
<th>Request Quantity</th>
</tr>
<%Do While Not rs.EOF %>
<tr align=center>
<td><%=rs("ItemCode")%></td>
<td align=left><%=rs("ItemName")%></td>
<td><%=rs("Quantity")%> </td>
<td><%=FormatCurrency(rs("Price"))%> </td><td><input name="RQty" type="text" size="3" maxlength="3" ></td>
<tr>
<%rs.MoveNext%>
<%loop%>
</table>
the form actions to AddTocart.asp, i can't seem to use Javascript or Vbscript functions for like form validation....please advice...
like compare quantity.
<%
'setting recordset and SQL statement
If Request("Qty") > rs("ItemQuantity")
Msgbox "Quantity not enough!!"
%>
i cannto do this right?...