获得更改购买数量:
<!--webbot BOT= "GeneratedScript " PREVIEW= " " startspan --> <script Language= "JavaScript "> <!--
function FrontPage_Form1_Validator(theForm)
{
var checkOK = "0123456789- ";
var checkStr = theForm. <%= "Q_ " & rs( "Product_Id ")%> .value;
var allValid = true;
var decPoints = 0;
var allNum = " ";
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
allNum += ch;
}
if (!allValid)
{
alert( "在 请输入正确的商品数量! 域中,只能输入 数字 个字符。 ");
theForm. <%= "Q_ " & rs( "Product_Id ")%> .focus();
return (false);
}
return (true);
}
//--> </script> <!--webbot BOT= "GeneratedScript " endspan -->
<form Action= "eshop.asp " Method= "POST " onsubmit= "return FrontPage_Form1_Validator(this) " name= "FrontPage_Form1 ">
<input type= "hidden " name= "MySelf " value= "Yes ">
<div align= "center "> <center>
<table border= "0 " cellspacing= "1 " width= "550 " class=main bgcolor= "#000000 "> ...........
’得到购买数量:
Quatity = CInt( Request( "Q_ " & rs( "Product_Id ")) )
......
FrontPage_Form1_Validator(this) '这this是什么意思?
还有下面两句是什么意思? "Q_ " 是什么数值?先谢谢啦
var checkOK = "0123456789- ";
var checkStr = theForm. <%= "Q_ " & rs( "Product_Id ")%> .value;
------解决方案--------------------1, <form Action= "eshop.asp " Method= "POST " onsubmit= "return FrontPage_Form1_Validator(this) " name= "FrontPage_Form1 ">
this 指当前对象,等于 document.FrontPage_Form1
2,var checkOK = "0123456789- ";
定义一个变量,这个变量的值是一个字符串 "0123456789- "
3,var checkStr = theForm. <%= "Q_ " & rs( "Product_Id ")%> .value;
Q_是