Well, I've html form with several radio button like this...
<tr class="AccountSettingtable">
<td class="tableHeader">+ Graphics</td>
<td class="tableHeader">Daily <input type="radio" name="graphics" value="daily" /></td>
<td class="tableHeader">Never <input type="radio" name="graphics" value="never" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Logo Design</td>
<td><input type="radio" name="logo" /></td>
<td><input type="radio" name="logo" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Flyers & Postar design</td>
<td><input type="radio" name="fly" /></td>
<td><input type="radio" name="fly" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Print Media</td>
<td><input type="radio" name="print" /></td>
<td><input type="radio" name="print" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Stationery</td>
<td><input type="radio" name="stationery" /></td>
<td><input type="radio" name="stationery" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Packaging Design</td>
<td><input type="radio" name="packaging" /></td>
<td><input type="radio" name="packaging" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Illustrations</td>
<td><input type="radio" name="illustration" /></td>
<td><input type="radio" name="illustration" /></td>
</tr>
In this form there are two radio button on top of the form.
1) Daily
2) Never.
So, is there any way to disable all button(which is related to never ) if user click never button(Radio button) and How do i do this?
Thanks a lot.
COMPLETE CODE..
<?php
include("include/session.php");
include("include/check.php");
include("database/db.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org
/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $_SESSION['uname'] .'s'. " Profile"; ?></title>
<link rel="stylesheet" type="text/css" href="css/accountpage.css" />
<link rel="stylesheet" type="text/css" href="css/accountpage.css" />
<link rel="stylesheet" type="text/css" href="css/UserAccount.css"/>
<link rel="stylesheet" type="text/css" href="css/stylesheet.css" />
<script type="text/javascript">
$('input#never').bind('click', function() {
$('input.never').attr('disabled', 'disabled');
$('input.daily').attr('disabled', '');
});
$('input#daily').bind('click', function() {
$('input.never').attr('disabled', '');
$('input.daily').attr('disabled', 'disabled');
});
</script>
</head>
<body>
<div class="AccountSettingmiddle">
<table width="631">
<td class="tableHeader">Daily <input id="daily" type="radio" name="graphics" value="daily" /></td>
<td class="tableHeader">Never <input id="never" type="radio" name="graphics" value="never" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Logo Design</td>
<td><input type="radio" name="logo" value="yes" class="daily" /></td>
<td><input type="radio" name="logo" value="no" class="never" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Flyers & Postar design</td>
<td><input type="radio" name="fly" value="yes" class="daily" /></td>
<td><input type="radio" name="fly" value="no" class="never" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Print Media</td>
<td><input type="radio" name="print" value="yes" class="daily" /></td>
<td><input type="radio" name="print" value="no" class="never" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Stationery</td>
<td><input type="radio" name="stationery" value="yes" class="daily" /></td>
<td><input type="radio" name="stationery" value="no" class="never" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Packaging Design</td>
<td><input type="radio" name="packaging" value="yes" class="daily" /></td>
<td><input type="radio" name="packaging" value="no" class="never" /></td>
</tr>
<tr class="AccountSettingtable">
<td class="tableElement">Illustrations</td>
<td><input type="radio" name="illustration" value="yes" class="daily" /></td>
<td><input type="radio" name="illustration" value="no" class="never" /></td>
</tr>
</table>
<script type="text/javascript">$(function() {
$('input#never').bind('click', function() { $('input.never').attr('disabled',
'disabled'); $('input.daily').attr('disabled', ''); }); $('input#daily').bind('click',
function() { $('input.never').attr('disabled', ''); $('input.daily').attr('disabled',
'disabled'); }); }); </script>
</div>
</body>
</html>