我有这样的代码:
<div class="field4"><label for="go" >Info <a href="helper/info.html?lightbox[width]=560&lightbox[height]=600" class="lightbox"><span class="helper open">?</span></a></label>
<select id="go" name="go">
<option value="">Please select an option</option>
<option value="yes">Yes</option>
<option value="no">No</option>
</select>
</div>
如果他们选择YES,我想调用特定地址的href,也许是一个模态框 这可以吗?
已经检查过,没看过怎么做。
好的更新是:
<div class="field4">
<img src="images/bugme.png" class="bugmeFloat"><label for="sms" >SMS Alerts <a href="helper/sms.html?lightbox[width]=560&lightbox[height]=600" class="lightbox"><span class="helper open">?</span></a></label>
<select id="sms" name="sms">
<option value="">Please select an option</option>
<option value="no">No thanks</option>
<option value="yes">Purchase SMS Messaging</option>
</select>
</div>
<!--inline script for modal open off select choice-->
<script type="text/javascript" language="javascript">
$(function() {
$('#sms').change(function() {
if ($(this).val() == 'yes') {
window.location = 'helper/sms.html?lightbox[width]=560&lightbox[height]=600';
}
});
});
</script>
<!--//end inline modal box open -->
它不是打开窗口或莫代尔......嗯
答案 0 :(得分:0)
是。你会有这样的事情:
$(function() {
$('#go').change(function() {
if ($(this).val() == 'yes') {
window.location = 'www.mynewaddress.com';
}
});
});
基本上,如果满足某个条件,则在更改选择值时,您将导航到新地址。
相关文件:
.change()
活动 - http://api.jquery.com/change/