Using a select or toggle all javascript function returns first value as NUL
I am using dynamic checkboxes and used a javascript function I found in this forum but it doesn't seem to work as expected. Its close but not exactly right. If I have three rows for instance and I manually select the three rows the value passed to the next screen is like this
1234,1235,1236
But when I use the select all, it looks more like this
,1234,1235,1236
This disrupts some of my sql statements and I'm wondering how to get around this. In my "Item", which is a pl/sql function body returning a sql, I put the javascript in the box labeled Region Header under Header and Footer Text.
Here is the javascript I am using.
<script type="text/javascript"> function ToggleAll(e) { if (e.checked) { CheckAll(); } else { ClearAll(); } } function Check(e) { e.checked = true; } function Clear(e) { e.checked = false; } function CheckAll() { var
ml = document.wwv_flow; var len = ml.elements.length; for (var i = 0; i < len; i++) { var e = ml.elements[i]; if (e.name == "f01") { Check(e); } } ml.f01.checked = true; } function ClearAll() { var ml = document.wwv_flow; var len = ml.elements.length; for
(var i = 0; i < len; i++) { var e = ml.elements[i]; if (e.name == "f01") { Clear(e); } } ml.f01.checked = false; } </script>