I would start by making the clicks events in prototype first and then
checking on if clicked or not.
perhaps not the best answer but I would do something like
<script src="jscripts/prototype.js" type="text/javascript"> </script>
<script type="text/javascript">
<!--
groups = {
group1: ["name1", "name2", "name3"],
group2: ["name3", "name5"],
group3: ["name4", "name6"]
};
/*************************************************************************
Function first Run
run on load action ...
**************************************************************************/
document.observe("dom:loaded", function() {
$('BoxGrp').observe('click', fillBoxes);
})
function fillBoxes(event) // if cicked this event fires
{
var element = event.element();
alert( element.id);
if ( $(element).readAttribute('type') == "checkbox"){ // make sure
if is the box and not the label/
alert("yes is class name group");
if($(element).checked) {
alert("clecked");
// process checked here
}else {
//unchecked here
// the id of the checkbox is the array grp name
}
}
}
//-->
</script>
<title>Untitled Document</title>
</head>
<body>
<div id='BoxGrp' class="Groups">
<div class="group">
<input type="checkbox" id="group1" />Group 1
</div>
<div class="group">
<input type="checkbox" id="group2" />Group 2
</div>
<div class="group">
<input type="checkbox" id="group3" />Group 3
</div>
</div>
<div class="names">
Names:
<div class="name">
<input type="checkbox" id="name1" />Name 1
</div>
<div class="name">
<input type="checkbox" id="name2" />Name 2
</div>
<div class="name">
<input type="checkbox" id="name3" />Name 3
</div>
<div class="name">
<input type="checkbox" id="name4" />Name 4
</div>
<div class="name">
<input type="checkbox" id="name5" />Name 5
</div>
<div class="name">
<input type="checkbox" id="name6" />Name 6
</div>
</div>
</body>
</html>
On 3/16/2012 5:43 AM, Jenny76 wrote:
I need a Prototype script to do exactly what this one does. Anyone
interested in walking me through what changes need to be made to turn
it into Prototype? I tried on my own yesterday, and need some
guidance.
http://jsfiddle.net/8wBg7/31/
Thanks in advance,
Jenny
--
EdenStreet Consulting
w:978-741-7518
c:978-821-1309
Twitter: martyateden
Skype: martyateden
--
You received this message because you are subscribed to the Google Groups "Prototype
& script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com.
To unsubscribe from this group, send email to
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en.