Hi, Why doesn't the second radio button "check" below? The first disabled OK. This is in a <form> tag, just snipped this out.. Thanks <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td valign="top"> <input type="radio" name="ingredientDetailsId" value="387" disabled="disabled" onChange="swapPrice('£11.99');" /> <span class="smallText"><strong><span class="sale">60 Capsules<span></span> </strong></span></td></tr> <tr> <td valign="top"> <input type="radio" name="ingredientDetailsId" value="388" checked="checked" onChange="swapPrice('£18.99');" /> <span class="smallText"><strong>270 Capsules </strong></span></td> </tr></table> Code (markup):
I believe you are doing it wrong... the format is <input type="radio" name="something" CHECKED> It actually doesn't have an internal variable (i guess this is whaty ou would call it?) set for it. Looks odd, but works.
And you have to add a value to checked if using XHTML (checked="checked"). If you don't mind me asking, why are you using a table to lay yout your form anyway?
Thanks guys... Dan: Why how else would I do it? CSS? I suppose I'm stuck in a time warp... Do you feel its worth while me learning CSS inside-out for positioning instead?
In a nutshell, yes. Tell you what. Show me the full HTML code for your form and I'll re-code it for you using semantic HTML and CSS for you.
Sounds like a plan! I will then use the same style on future designs. I did make the site 4 years ago so maybe CSS wasn't the way to go then. Its not very large but will make good learning\reading for me! <table width="150" border="0" cellspacing="0" cellpadding="2" style="padding: 0px 0px 0px 0px;" > <tr> <td class="defaultBold">Price:</td> <td colspan="2"><span id="mySpan" style="font-size:15px; font-weight:bold;">£12.99</span><strong></td> </tr> <tr> <td ><strong>Amount:</strong></td> <td> <select name="amount"> <option value="1" selected>1</option> <option value="2" >2</option> <option value="3" >3</option> <option value="4" >4</option> <option value="5" >5</option> <option value="6" >6</option> <option value="7" >7</option> <option value="8" >8</option> <option value="9" >9</option> <option value="10" >10</option> <option value="11" >11</option> <option value="12" >12</option> <option value="13" >13</option> <option value="14" >14</option> <option value="15" >15</option> <option value="16" >16</option> <option value="17" >17</option> <option value="18" >18</option> <option value="19" >19</option> <option value="20" >20</option> <option value="21" >21</option> <option value="22" >22</option> <option value="23" >23</option> <option value="24" >24</option> <option value="25" >25</option> <option value="26" >26</option> <option value="27" >27</option> <option value="28" >28</option> <option value="29" >29</option> <option value="30" >30</option> <option value="31" >31</option> <option value="32" >32</option> <option value="33" >33</option> <option value="34" >34</option> <option value="35" >35</option> <option value="36" >36</option> <option value="37" >37</option> <option value="38" >38</option> <option value="39" >39</option> <option value="40" >40</option> <option value="41" >41</option> <option value="42" >42</option> <option value="43" >43</option> <option value="44" >44</option> <option value="45" >45</option> <option value="46" >46</option> <option value="47" >47</option> <option value="48" >48</option> <option value="49" >49</option> <option value="50" >50</option> </select> </td> <td > </td> </tr> <tr> <td colspan="3"> <strong><a href="#">Option:</a></strong><br /> <table width="100%" border="0" cellspacing="1" cellpadding="1"> <tr> <td valign="top"> <input type="radio" name="ingredientDetailsId" value="387" disabled="disabled" onChange="swapPrice('£11.99');" /> <span class="smallText"><strong><span class="sale">60 Capsules<span></span> </strong></span></td> </tr> <tr> <td valign="top"> <input type="radio" name="ingredientDetailsId" value="388" selected="selected" onChange="swapPrice('£18.99');" /> <span class="smallText"><strong>270 Capsules </strong></span></td> </tr> <tr> <td valign="top"> <input type="radio" name="ingredientDetailsId" value="1034" onChange="swapPrice('£100.99');" /> <span class="smallText"><strong>999 </strong></span></td> </tr> </table> </td> </tr> <tr> <td colspan="3" align="center"><br /> <input type="submit" name="addToBasket" class="button" value="Add To Basket"> <input type="hidden" name="mainIngredientId" value="387"> <input type="hidden" name="flavourId" value="0"> <input type="hidden" name="sweetenerId" value="0"> <input type="hidden" name="containerId" value="0"> </td> </tr> </table> PHP: