有没有办法在点击第一个按钮后启用第二个按钮?
<form method="post">
<fieldset>
<legend>Option 1</legend>
<input class="clickbox" type="radio" name="1" />1
<br />
<input class="clickbox" type="radio" name="1" />2
<br />
</fieldset>
<fieldset>
<legend>Option 2</legend>
<input class="clickbox" type="radio" name="2" />1
<br />
<input class="clickbox" type="radio" name="2" />2
<br />
</fieldset>
<input type="submit" value="Checkout" id="submitbutton" disabled="disabled" />
</form>
<br />
<input type="button" value="Next Button" disabled="disabled">
答案 0 :(得分:0)
<input type="submit" value="Checkout" id="submitbutton" disabled="disabled" class="submit button" />
<input type="button" id="nextButton" value="Next Button" disabled="disabled">
<script>
$(function() {
$("#submitbutton").click(function() {
$('#nextButton').attr('disabled', false);
});
});
</script>
答案 1 :(得分:0)
在这里工作:
$('form input[type="radio"]').click(function () {
var total = $('form fieldset').length;
$('#submitbutton').prop('disabled', ($('input:checked').length === total) ? false : true)
});
$('#submitbutton').click(function(){
if($(this).prop('disabled') == false)
{
$('input[type=button]:last').prop('disabled', '');
alert("its work!");
}
});