You Now Here »

[ASK] Tentang Radio Button jquery show/hide when click action  (Read 6456 times)

maszaki

  • More Share Forum Topic
  • [MS] pendatang baru
  • *
  • maszaki kurang gaul.
  • Rep Power: 0
  • Join: September 25, 2011
  • Posts: 9
  • Poin: 6
  • IP member tracker Logged


sob,ane kan buat radio button dengan beberapa pilihan,nah,salah satuny ane pengen buat jika di pilih ntar langsung kluar form tepat di bawahnya gitu :D
bleh liat contoh script ny sob?


View Mobile Web Short URL:
« Last Edit: March 23, 2012, 01:30:11 PM by DANNY »

DANNY

G-Plus Author
  • ADMINISTRATOR
  • More Share Forum Topic
  • [MS] kepala suku
  • *
  • DANNY sangat terkenal!DANNY sangat terkenal!DANNY sangat terkenal!DANNY sangat terkenal!DANNY sangat terkenal!DANNY sangat terkenal!
  • Rep Power: 6
  • Join: September 30, 2009
  • Posts: 11,931
  • Poin: 193.924
    • WWW
  • IP member tracker Logged
Re: [ASK]Tentang Radio Button
« Reply #1 on: March 23, 2012, 01:27:15 PM »
cekidot
Sample Jquery Hide show button click
powered by www.ms-room.com
you can test run in here https://www.ms-room.com/html-tester/

Code: [Select]
<!------------------------------------
Sample Jquery Hide show button click
powered by www.ms-room.com
-------------------------------------->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
   $('#button1').click(function() {
      $('#form1').show('slow');
      $('#form2').hide('slow');
   });
   $('#button2').click(function() {
      $('#form2').show('slow');
      $('#form1').hide('slow');
   });
})
</script>
<form>
<input type="radio" name="buttonname" id="button1" />Form 1 show<br />
<input type="radio" name="buttonname" id="button2" />Form 2 show<br />
</form>

<div style="display:none" id="form1">
<input type="text" value="name form 1"><br>
<textarea>Form 1 Here</textarea>
</div>
<div style="display:none" id="form2">
<input type="text" value="name form 2"><br>
<textarea>Form 2 Here</textarea>
</div>

regards
moreshare
  :beer: