0
我有一個選擇表單的網站,並試圖使其工作,以便在提交表單時,選擇表單保留用戶選擇的內容。我需要使用servlet或Javascript的JSP。以JSP或Javascript的形式保留用戶選擇
<form method="post" id="mainForm" name="mainForm">
<div>
<label style="margin-left: 10px;" for="specialty">Specialty:</label>
<select name="specialty">
<option value="ob/gyn">OB/GYN</option>
<option value="surgeon">Surgeon</option>
<option value="heart surgeon">Heart Surgeon</option>
<option value="pediatrician">Pediatrician</option>
<option value="general physician">General Physician</option>
</select>
</div>
<div>
<label style="margin-left: 10px;" for="zipCode">ZIP Code:</label>
<input type="text" name="zipCode" value=<%=patient.getZip().substring(0, 5) %>>
</div>
<div>
<label style="margin-left: 10px;" for="range">Range From ZIP Code: </label>
<select name="range">
<option value="5">Exact (Match all 5 digits)</option>
<option value="4">Match first 4 digits</option>
<option value="3">Match first 3 digits</option>
<option value="2">Match first 2 digits</option>
<option value="1">Far (Match only first digit)</option>
</select>
</div>
<input type="submit" name="findExpert" value="Find Expert" />
我會添加什麼,使這項工作?