0
我有一個應用程序,用戶掃描條形碼並提交表單。麻煩的是,掃描儀偶爾會出現雙重掃描,所以或者XXX預計值會是XXXXXX,然後表單提交,或者表單快速連續提交兩次。我想以某種方式添加一些暫停條件,以防止敏感的雙重掃描。有任何想法嗎 ?敏感掃描儀問題。防止雙重掃描
目前代碼
<script>
function validateForm(form) { //This is the name of the function
if (form.wonumber.value == "OP") { //This checks to make sure the field is not empty
alert("Cant Submit."); //Informs user of empty field
form.wonumber.value = ""
return false; //This prevents the form from being submitted
}
return true
}
</SCRIPT>
<form action="outer.asp" method="post" name="form100" id="form100" onSubmit="return validateForm(this)">
<div align="center">
<span class="style1 style4 style8">
Scan Parts into Outer <%=request.querystring("id")%>;</span>
<p class="style1 style2">
<input name="wonumber" type="text" id="wonumber" style="height:80px;font-size:50pt;" onChange="return validateForm(this)" size="7">
</p>
<p class="style1 style10"><%=description1%> <span class="style1 style2 style10">
</form>
我不認爲你提供的代碼片段告訴整個故事。你會編輯你的原始帖子並插入整個代碼嗎? –
更新了原始文章以包含整個表單代碼。 – Emma
如果您的閱讀器中的字符數超過最大值,是否可以簡單地清除表單? –