Why does the following code not work?
Example: http://jsfiddle.net/ZZe5X/18/
$('.submit').submit(function () {
e.preventDefault()
if ($('input[type="checkbox"]').is(':checked')) {
alert('ok')
} else {
alert('no')
}
})
Why does the following code not work?
Example: http://jsfiddle.net/ZZe5X/18/
$('.submit').submit(function () {
e.preventDefault()
if ($('input[type="checkbox"]').is(':checked')) {
alert('ok')
} else {
alert('no')
}
})
Okey:
$('.submit').submit(function () { should be $('.submit').submit(function (e) {submitthis should work: http://jsfiddle.net/voigtan/ZZe5X/26/
See the tweaked example: http://jsfiddle.net/ZZe5X/33/
.submitclass and a submit input. check this jsfiddle.net/ZZe5X/32