keuzerondjes zullen de selectie van een andere knop in dreamwever cs5 niet deselecteren

enter link description hereenter code here My problem is that the radio buttons won't deselect once selected. This form is connected to a PHP file that I build for my homework. In Dreamweaver if I keep the default value for the name attribute I don't have a problem with the buttons, but since the value of the name attribute has to match the name attribute in the PHP file I can't keep the default name. I've tried using group buttons and single buttons and copying them. In a text page I was able to get buttons to deselect when another button was selected. And then it stopped working, all the buttons stayed checked. I'm confused because I thought radio buttons contained boolean values, when one is selected the other is deselected. Any suggestions? Here is the code

 
 
 <head>
 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 <title>Homework 7</title>
 <script type="text/javascript">
 function edits()
 {
 if(document.getElementById("name").value=="")
 {
alert("Please enter your whole name.")
return false;
 }
if(document.getElementById("jarreau").checked=="")
 {
alert("Please enter your whole name.")
return false;
 }
else if(document.getElementById("aretha").checked=="")
 {
alert("Please enter your whole name.")
return false;
 }
else if(document.getElementById("withers").checked=="")
 {
alert("Please enter your whole name.")
return false;
}
else if(document.getElementById("joel").checked=="")
 {
alert("Please enter your whole name.")
return false;
}
else if(document.getElementById("warwidk").checked=="")
{
alert("Please enter your whole name.")
return false;
}
if(document.getElementById("rate").value=="")
{
alert("Please enter your whole name.")
return false;

if(document.getElementById("email").value=="")
{
alert("Please enter your whole name.")
return false;
 }
}
else return true;
}

 </script>
 
 </head>

 <body>
 

Old School Concert

 <table width="87%" border="0" cellspacing="0" cellpadding="2">
 <tr>
 <th align="left" width="19%" scope="col">Al Jarreau</th>
 <th align="left"width="13%" scope="col">Aretha Franklin</th>
  <th align="left"width="16%" scope="col">Bill Withers</th>
 <th align="left"width="19%" scope="col">Billy Joel</th>
 <th align="left"width="19%" scope="col">Dionne Warwick</th>
</tr>
<tr>
<td>Al Jarreau</td>
<td>aretha franklin</td>
<td>Bill Withers</td>
<td>Billy Joel</td>
<td>Dionne Warwick</td>
</tr>

In order to keep bringing you the best in old school legends please fill out this brief survey.

 <form name="service" method="post" action="concert.php" />
 
<input name="name" type="text" id="fname" size="20" maxlength="15" />
(optional)

<input name="name" type="text" id="lname" size="20" maxlength="15" /> (optional)










<input name="rate" type="text" id="rate" size="5" maxlength="2" />
<input name="email" type="text" id="email" size="45" maxlength="45" />




<input type="button" value="submit" name="" id="" onclick="edits()" /> </form> </body> </html>
0

1 antwoord

je moet alle keuzerondjes dezelfde "naam" geven als:

<input name="thesamegroup" type="button" value="submit"  id="" onclick="edits()" />
<input name="thesamegroup" type="text" id="email" size="45" maxlength="45" />
1
toegevoegd
Ik accepteer dit antwoord, maar in het begin was ik in de war, ik dacht dat het de ID's waren die dezelfde naam moesten hebben.
toegevoegd de auteur swydell, de bron