Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Sep 2006
    Location
    Pakistan
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Regular Coder
    Join Date
    Feb 2008
    Location
    Edinburgh - Scotland
    Posts
    107
    Thanks
    0
    Thanked 12 Times in 12 Posts
    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.

  • #3
    New Coder
    Join Date
    Sep 2006
    Location
    Pakistan
    Posts
    75
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    Regular Coder
    Join Date
    Feb 2008
    Location
    Edinburgh - Scotland
    Posts
    107
    Thanks
    0
    Thanked 12 Times in 12 Posts
    You want the HTML / Javacript forum, your in the completely wrong place.

  • #5
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    Yes indeed.
    Despite the similar sounding names, Java is not the same as Javascript.
    Moving from Java forum to Javascript forum.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #6
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,926
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •