4 Replies Latest reply on Apr 21, 2006 8:22 AM by jdeline

    onClick for table area???

    PackinDaMAC Level 1
      Is there a way i can take this radio button i have and i want to click anywhere in the table row and have the button checked....Is this possible in CFML??? If so can i get a lil code snippet or a link......thanks......
        • 1. Re: onClick for table area???
          jdeline Level 1
          Wrap your <TR> tag in <A></A> and use onClick to check the radio button.
          • 2. Re: onClick for table area???
            PackinDaMAC Level 1
            so should it look like this???

            <table cols="3" width="760" height="1">
            <th align="left">
            <tr bgcolor="black">
            <td><font face="Times New Roman, Times, serif" size="+1" color="#FFFFFF">
            Choose Your Location:</font>
            </th>
            </table>
            <table cols="3" height="1" width="750">

            <a><tr>
            <td align="left" width="95" onClick="checked"><font face="Times New Roman, Times, serif">
            <input type="radio" name="location" value="Centerville 8371 Yankee St. Centerville Ohio, 45448 Phone: (937)312-9368 Fax: (937)312-9369">Centerville 8371 Yankee St.  &nbsp   Centerville Ohio, 45448<br> &nbsp   Phone: (937)312-9368 <br> &nbsp   Fax:  &nbsp &nbsp(937)312-9369</td>

            <td width="100" onClick="checked"><font face="Times New Roman, Times, serif">
            <input type="radio" align="Center" name="location" value="Beavercreek 2633 Commons Blvd, Suite 110 Beavercreek, OH 45431 Phone: (937)312-9368 Fax: (937)312-9369">Beavercreek 2633 Commons Blvd,  &nbsp &nbsp&nbspSuite,110 Beavercreek, OH 45431<br>  &nbsp &nbsp&nbspPhone: (937)312-9368<br>  &nbsp &nbsp&nbspFax:  &nbsp &nbsp(937)312-9369</font></td>

            <td width="100" onClick="checked"><font face="Times New Roman, Times, serif">
            <input type="radio" name="location" value="Tipp City 1475 W. Main Street Tipp City, OH 45371 Phone: (937)312-9368 Fax: (937)312-9369">Tipp City 1475 W. Main Street  &nbsp &nbsp&nbspTipp City, OH 45371<br> &nbsp &nbsp&nbspPhone: (937)312-9368<br> &nbsp &nbsp&nbspFax:  &nbsp &nbsp(937)312-9369</font>
            </td>
            </tr>
            </a>
            </table>
            • 3. Re: onClick for table area???
              Dan Bracuk Level 5
              <input type="radio" name="abc" value="val1">
              <a href="javascript:void(0)" onClick="abc[0].checked=true;">Value 1</a>

              <input type="radio" name="abc" value="val2">
              <a href="javascript:void(0)" onClick="abc[1].checked=true;">Value 2</a>

              • 4. Re: onClick for table area???
                jdeline Level 1
                Now that I see your code, it seems that you want to have the radio button checked when you click on a column. Your example has three columns. I would suggest you wrap your <TD></TD> in the <A> tag.

                Also, your onClick syntax is not correct. http://www.comptechdoc.org/independent/web/cgi/javamanual/javacheckbox.html should be of some help.