August 16, 2015

javascript validation for radio button in php.

<input type='radio' class='w1' name='w1' value='1'>1<br>
<input type='radio' class='w1' name='w1' value='2'>2<br>
<input type='radio' class='w1' name='w1' value='3'>3<br>

<script>
if ( $(':radio[class=w1]').attr('checked') != 'checked' ) {
    alert('Radio not checked');
}
</script>

Enjoy!

No comments:

Post a Comment

The Future of Technology: Emerging Trends to Watch in 2025

Introduction As we navigate through 2025, the technological landscape continues to evolve at an unprecedented pace. Innovations that once se...