File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes HTML, CSS and JavaScript and the fly likes How to activate the Radio button and select option Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "How to activate the Radio button and select option" Watch "How to activate the Radio button and select option" New topic

How to activate the Radio button and select option

Arjun Palanichamy
Ranch Hand

Joined: Jul 15, 2006
Posts: 51

I have a html form, that have some selection option,radio button and all.

default first column radio button enabled other column disabled, now i want the select the radio button to be enabled,

here my code.

<tr bgcolor="#DEEDF4"><td align="center">
<input type="radio" name="bname_rad" id="bname1" on click="toggle(true)" value="LeaderBoard"></td>

<td align="center" class="style5Tx">Leaderboard</span>
<input type="hidden" name="bname" id="b1" value="LeaderBoard"></td>

<td align="center" class="style5Tn">20 $
<input type="hidden" name="adcost1" id="adcost1" value="20"></span></td>

<td align="center" ><span style="font-size:13px;font-family:">
<select disabled="disabled" id="no_imp1" name="imp1" size="1" onchange="cal_total(this);" class="style5To">
<option value="1000" selected="selected">1,000</option>
<option value="2000">2,000</option>
<option value="5000">5,000</option>
<option value="10000">10,000</option>
<option value="15000">15,000</option>
<option value="20000">20,000</option>
<option value="25000">25,000</option>
<option value="30000">30,000</option>
<option value="40000">40,000</option>
<option value="50000">50,000</option>
</select> <input type="hidden" value="tot" name="total"></td>

<td align="center" class="style5Tn"><span id="tot"><b>20</b></span><span style="color:red;"> $</span></b></td>

<td class="style5Tn" align="center">

<input disabled="disabled" type="radio" name="paymode" id="p11" value="onetime">One Time<br>

<input disabled="disabled" type="radio" name="paymode" id="p12" value="month">Monthly   </td>


Script Code ///

function toggle()
document.getElementById("p11").disabled = true;
document.getElementById("p12").disabled = true;

i want select the first radio button (ID=bname1) to activate -- >
and Id=P11,Id=P12

Please help me solve this problem...

Advanced Thanks.
[ May 20, 2008: Message edited by: Arjun Palanichamy ]
Rob Spoor

Joined: Oct 27, 2005
Posts: 20276

Moved to HTML & JavaScript.

How To Ask Questions How To Answer Questions
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

Please be sure to use UBB code tags when posting code to the forums. Unformatted code is extermely hard to read and many people that might be able to help you will just move along. Please read this for more information.

You can go back and change your post to add code tags by clicking the .

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: How to activate the Radio button and select option
It's not a secret anymore!