0
我需要在點擊插入按鈕時檢查是否所有字段都已填充。 這是我的看法:.NET中的驗證MVC
<body>
<form name="form1">
<h2>MEDICATION</h2>
<div class="med">
<pre>
<label>Patient code</label> <input type="text" id="pat" name="ptcode" size="25" value="" /> <label>ICD10</label> <input style="width:85px;height:30px;" type="text" name="icd10" value=""> <button style="height:30px;width:59px;" name="search" onclick="openicd()";>search</button><br />
<label>Medication</label> @Html.DropDownListFor(Model => Model.medication, Model.medication,"Select Medication", new { style = "width:200px; height :30px" }) <button style="height:30px;"onclick="openmedication()";>search</button> Prescription Date <input type="date" class="sizetestdate" name="testdate" style="width:140px;height:30px;" value="">
<label>Strength</label> @Html.DropDownListFor(Model => Model.strength, Model.strength, "Select Strength", new { style = "width:200px; height :30px" }) Start Date <input type="date" class="sizetestdate" name="testdate" style="width:140px;height:30px;" value=""> End Date <input type="date" class="sizetestdate" name="testdate" style="width:140px;height:30px;" value=""><br />
<label>Form</label> @Html.DropDownListFor(Model => Model.form, Model.form, "Select form", new { style = "width:200px; height :30px" }) Renewal Date <input type="date" class="sizetestdate" name="testdate" style="width:140px;height:30px;" value=""><label> Days Supply</label> <input type="text" style="width:85px;height:30px;" name="supply" value=""> <br />
<label>Route</label> @Html.DropDownListFor(Model => Model.route, Model.route, "Select route", new { style = "width:200px; height :30px" }) <label>Pharmacy</label> @Html.DropDownListFor(Model => Model.pharmacy, Model.pharmacy, "Select Pharmacy", new { style = "width:200px; height :30px" })<br />
<label>Dose</label> @Html.DropDownListFor(Model => Model.dosage, Model.dosage, "Select Dose", new { style = "width:200px; height :30px" })
</pre>
</div>
</form>
<hr />
<div class="wrapper">
<button class="button" style="height:30px;" id="a" >Insert</button> <button class="button" style="height:30px;" id="b">Update</button> <button class="button" style="height:30px;" id="c">Delete</button>
</div></body>
</html>
雖然這種聯繫可以回答這個問題,這是更好在此包括答案的基本部分並提供參考鏈接ENCE。如果鏈接頁面更改,則僅鏈接答案可能會失效。 – Dwhitz
@Dwhitz Ok thx,編輯 – wtMaxim