Forum Moderators: open
<form action="#" class="myForm" id="myForm1">
<div class="radio">
<label><input type="radio" name="product" value="example.com">Product 1</label>
</div>
<div class="radio">
<label><input type="radio" name="product" value="example.com">Product 2</label>
</div>
<div class="radio">
<label><input type="radio" name="product" value="example.com">Product 3</label>
</div>
<div>
<button type="submit"> GO FURTHER</button>
</div>
</form> <script>$(function(){
$(".myForm").submit(function(e) {
e.preventDefault();
window.location = $(this).find('input[type="radio"]:checked').val();
});
});
</script> <script>
$(function() {
$(".myForm1").submit(function(e) {
e.preventDefault();
window.location = $(this).find('input[type="radio"]:checked').val();
});
$('#myForm1').validate({
rules: {
product: {
required: true
}
},
messages: {
Product: {
required: "Please select a Product<br/>"
}
},
errorPlacement: function(error, element) {
if (element.is(":radio")) {
error.appendTo(element.parents('.myForm'));
} else { // This is the default behavior
error.insertAfter(element);
}
}
});
});</script> $('#nsoForm1').submit(function() {
if ($('input:radio', this).is(':checked')) {
// Do this if a button is checked
$(".nsoForm").submit(function(e) {
e.preventDefault();
window.location = $(this).find('input[type="radio"]:checked').val();
});
})
} else {
alert('Please select something!');
return false;
}
}); $(function(){
$(".myForm").submit(function(e) {
e.preventDefault();
window.location = $(this).find('input[type="radio"]:checked').val();
});
});