(View Original Web?)

HOBBY > WEBMASTER

[ASK] Tentang Radio Button jquery show/hide when click action


(Page 1 of 1)
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?
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:
<!------------------------------------
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
 
(Page 1 of 1)

Navigation

Back Sub-Forum