Show Hide button by click on checkbox

F

femtox77

Hi, I try to show or hide a button when I click on checkboxes. I
explain better. I'm learnig to use Jquery framework. I have a page
with many rows and every row has a checkbox. I wanna show a button
only when i check checkboxes. So I can show the button on every click
but when i "reclick" to uncheck the checkboxes the button goes away.
Any idea?

Thank you
Fem
 
T

Thomas 'PointedEars' Lahn

[...] I'm learnig to use Jquery framework.

You better unlearn. Unfortunately, jQuery is junk, and will remain
so until some serious software design issues have been resolved.


PointedEars
 
F

femtox77

Will this help?

<html>
<head>
<title>checkboxs.htm</title>
<script type="text/javascript">
function checkboxs(but) {
var what = document.getElementById(but).className;
(what == "hide") ? what = "show" : what = "hide";
document.getElementById(but).className = what;}

</script>
<style type="text/css">
.hide { visibility:hidden }
.show { visibility:visible }
</style>
</head>
<body>
<form>
<table border="1">
<tr>
<th>Checkbox<hr></th>
<th>Button<hr></th>
</tr>
<tr>
<th><input type="checkbox" onclick="checkboxs('but1')"></th>
<th><input type="button" value="Button 1" id="but1" class="hide"></th>
</tr>
<tr>
<th><input type="checkbox" onclick="checkboxs('but2')"></th>
<th><input type="button" value="Button 2" id="but2" class="hide"></th>
</tr>
<tr>
<th><input type="checkbox" onclick="checkboxs('but3')"></th>
<th><input type="button" value="Button 3" id="but3" class="hide"></th>
</tr>
</table>
</form>
</body>
</html>

thank for the answer...i try this idea...bye
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top