Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-17-2010, 04:42 AM   PM User | #1
zami
New Coder

 
Join Date: Sep 2006
Location: Pakistan
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
zami is an unknown quantity at this point
radio buttons in jave or ajax

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.
http://rapidshare.com/files/437311384/website.gif
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
thanks
zami
zami is offline   Reply With Quote
Old 12-17-2010, 05:56 PM   PM User | #2
renegadeandy
Regular Coder

 
Join Date: Feb 2008
Location: Edinburgh - Scotland
Posts: 107
Thanks: 0
Thanked 12 Times in 12 Posts
renegadeandy is an unknown quantity at this point
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.
renegadeandy is offline   Reply With Quote
Old 12-18-2010, 10:01 AM   PM User | #3
zami
New Coder

 
Join Date: Sep 2006
Location: Pakistan
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
zami is an unknown quantity at this point
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
thanks
zami
zami is offline   Reply With Quote
Old 12-18-2010, 12:24 PM   PM User | #4
renegadeandy
Regular Coder

 
Join Date: Feb 2008
Location: Edinburgh - Scotland
Posts: 107
Thanks: 0
Thanked 12 Times in 12 Posts
renegadeandy is an unknown quantity at this point
You want the HTML / Javacript forum, your in the completely wrong place.
renegadeandy is offline   Reply With Quote
Old 12-18-2010, 04:05 PM   PM User | #5
Fou-Lu
God Emperor


 
Fou-Lu's Avatar
 
Join Date: Sep 2002
Location: Saskatoon, Saskatchewan
Posts: 15,662
Thanks: 4
Thanked 2,452 Times in 2,421 Posts
Fou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to allFou-Lu is a name known to all
Yes indeed.
Despite the similar sounding names, Java is not the same as Javascript.
Moving from Java forum to Javascript forum.
__________________
As of PHP 5.5, the MySQL library has been officially deprecated. It is recommended to move to either MySQLi or PDO libraries for your mysql connectivity. See here for help choosing which interface you prefer: http://php.net/manual/en/mysqlinfo.api.choosing.php
Fou-Lu is offline   Reply With Quote
Old 12-18-2010, 04:45 PM   PM User | #6
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,044
Thanks: 197
Thanked 2,412 Times in 2,390 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
This should do the trick:-

Code:
<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()">
</form> 

<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";
}
}
}

</script>
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.
Philip M is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 04:33 AM.


Advertisement
Log in to turn off these ads.