请问选择不同的radio,点击submit按钮就指向到不同的url。。
<form name="create" action="http://www.buffalobillsjerseysstore.com/index.php?main_page=create_account" method="post" id="account"> <p>Checkout Options:</p>
<label style="cursor: pointer;" for="register">
<input type="radio" checked="checked" id="register" value="register" name="account">
<b>Register Account</b></label>
<br>
<label style="cursor: pointer;" for="guest">
<input type="radio" id="guest" value="guest" name="account">
<b>Guest Checkout</b></label>
<br>
<p>By creating an account you will be able to shop faster, be up to date on an order's status, and keep track of the orders you have previously made.</p>
<div style="text-align: right;"><a class="button" onclick="$('#account').submit();"><input type="image" src="includes/templates/Fnflbills/buttons/english/button_submit.gif" alt="Continue" title=" Continue " name="registrationButton" /></a></div>
</form>
这个是onclick 里面的jq代码要如何操作呢?
function accountSubmit(){
var submitType = $("input[name='account']").val();
if(submitType=='register'){
$('#account').attr('action','http://www.buffalobillsjerseysstore.com/index.php?main_page=create_account');
}else if(submitType=='guest'){
$('#account').attr('action','http://www.buffalobillsjerseysstore.com/index.php?main_page=guest_account');
}
$('#account').submit();
}
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。