View Full Version : radio buttons in jave or ajax

12-17-2010, 05:42 AM
hi again
i m making an asp page in which user select 1 radio button and on its selection other selection visible, i m typing here example how it will work

provience * District * Taluka*
here are 3 radio buttons, now if user click on profience, a querly will execute and will show data according to provience data, and if user click on district a list of district will show and user click district and can get data according to district, same on clicking user have district list and then correspondingly tehsil lists so user can get data according to tehsil.
I also want when use click on provience other buttons wil invisible, and then ueser click on district, provience button wil dissable.
plz help me

12-17-2010, 06:56 PM
From what I can gather from your post yu want somethint to show on a button click.

There are benefits to both, if you are talking about JSP / Servlets or Ajax, I would simply do ajax using ASP since you already have ASP and JSP / Servlets are equivalent and Ajax is the only piece missing.

12-18-2010, 11:01 AM
what i want, 3 radio buttons in a row [* Provienece, * District, * Tehsil], if user select provience, user can get information regarding provience, same time other 2 radio buttons will invisible, when user select District provience and tehsil radio buttons will invisible, and when user click on thesil, district and thesil radio buttons visible. and user can get data .
plz help

12-18-2010, 01:24 PM
You want the HTML / Javacript forum, your in the completely wrong place.

12-18-2010, 05:05 PM
Yes indeed.
Despite the similar sounding names, Java is not the same as Javascript.
Moving from Java forum to Javascript forum.

Philip M
12-18-2010, 05:45 PM
This should do the trick:-

<form name = "myform">
Provience <input type = "radio" name = "rad1" onclick = "show()">
District <input type = "radio" name = "rad1" onclick = "show()">
Tehsil <input type = "radio" name = "rad1" onclick = "show()">

<div id = "d1" style="display:none">Information about Provience</div>
<div id = "d2" style="display:none">Information about District</div>
<div id = "d3" style="display:none">Information about Tehsil</div>

<script type = "text/javascript">

function show() {
for (var i = 1; i<=3; i++) {
document.getElementById("d" + i).style.display="none";
for (var i = 0; i <document.myform.rad1.length; i++) {
if (document.myform.rad1[i].checked) {
document.getElementById("d" + (i+1)).style.display="block";


I don't really understand "when use click on provience other buttons wil invisible, and then ueser click on district, provience button wil dissable".
Are you saying that the user has only one opportunity to choose, and if he selects one radio the others then become disabled? That does not sound like a good idea.

Quizmaster: Florence Nightingale was born in which country - Italy, Austria or France?
Contestant: There may be a clue in the name. Yes, I'll say France.