請有人建議我,提交前進行表單驗證的最佳方式是什麼
什麼是提交之前進行表單驗證的最佳方式是什麼?
實際情況就好像我有一個叫save的按鈕,所以當用戶按下保存按鈕時。
我需要驗證數據並將流傳遞到服務器以將數據存儲在表中。
而是在服務器端做的表單數據的驗證,是否有任何可能的方式來檢查那些在客戶端本身
<form>
<header>
<h1>Testing </h1>
</header>
<p>
Receipt number:
<input type="text" id="grn" class="tb1" onkeypress="return isNumber(event)" /> Type
<select name="evalu" id="evalu">
<option value="electrical">Electrical</option>
<option value="mechanical">Mechanical</option>
</select>
cad
<select name="cd" id="cd">
<option value="unit1">xv</option>
<option value="unit2">ed</option>
</select>
<input type="button" id="find" value="Find" class="button0" />
<br>
<br> Report No
<input type="text" name="irepno" id="irepno" class="tb1" maxlength="8" /> date
<input type="text" name="idt" id="idt" class="tb1" value="<%= new SimpleDateFormat(" dd-MM-yyyy ").format(new java.util.Date())%>">
<input type="button" id="search" value="Search" class="button0" />
<br></br>
<input type="button" value="Save the record" id="saverecord" class="button0">
</p>
</form>
例如+ 1 –