我今天正在这样做,但不希望它打开一个新标签。我希望它使用相同的页面:
<td>
<form>
<select name="URL" onchange="window.open(this.value);">
<option selected="selected" value="">...</option>
<option value="ListArchivedProjects">List archived projects</option>
<option value="ListArchivedCertificates">List archived certificates</option>
<option value="SelectProject">List Projects</option>
<option value="ListCertificates">List Certificates</option>
<option value="AddProjectForm.jsp">+ Add new project</option>
<option value="AddCertificateForm.jsp">+ Add new certificate</option>
</select>
</form>
</td>
答案 0 :(得分:1)
在同一页上?
location.href = this.value;
答案 1 :(得分:1)
<td>
<form>
<select name="menu1" id="menu1">
<option selected="selected" value="">...</option>
<option value="ListArchivedProjects">List archived projects</option>
<option value="ListArchivedCertificates">List archived certificates</option>
<option value="SelectProject">List Projects</option>
<option value="ListCertificates">List Certificates</option>
<option value="AddProjectForm.jsp">+ Add new project</option>
<option value="AddCertificateForm.jsp">+ Add new certificate</option>
</select>
<script type="text/javascript">
var urlmenu.onchange = function() {
window.open( this.options[ this.selectedIndex ].value, '_self');
};
</script>
</form>
</td>