基本上只是试图让这个表单使用onclick来打开当前窗口中的链接...我想我会在window.open中使用_self选项但是我没有运气。
<form data-theme="b" name="form21">
<label style="font-size:18px; width:100%" data-theme="b" for="select-choice-1" class="select">Select your kennel's state:</label>
<select name="menu" id="select-choice-1">
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Arizona</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Arkansas</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">California</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Maine</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Michigan</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Nebraska</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">New York</option>
</select>
</form>
<button type="submit" data-theme="b" data-mini="true" class="ui-btn-hidden" onClick="window.open(document.form21.menu.options[document.form21.menu.selectedIndex].value);" aria-disabled="false">Go</button>
答案 0 :(得分:0)
您应该使用location.href
从您自己的页面重定向:
<form data-theme="b" name="form21">
<label style="font-size:18px; width:100%" data-theme="b" for="select-choice-1" class="select">Select your kennel's state:</label>
<select name="menu" id="select-choice-1">
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Arizona</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Arkansas</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">California</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Maine</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Michigan</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">Nebraska</option>
<option value="http://xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx">New York</option>
</select>
</form>
<button type="submit" data-theme="b" data-mini="true" class="ui-btn-hidden" onClick="location.href = document.form21.menu.options[document.form21.menu.selectedIndex].value;" aria-disabled="false">Go</button>