Just realized I don't need the loop in the javascript. You should be
able to shorten the function to:
<script>
function updateCatIDs() {
obj = document.getElementById('selectedCats');
obj.setAttribute("value",aSelected.join(","));
}
</script>
On Tue, 15 Feb 2005 16:04:29 -0500, Spike <[EMAIL PROTECTED]> wrote:
> Answering my own question...
>
> The IDs of all the assigned categories are stored in an array called
> aSelected. This array is updated as boxes are checked and unchecked.
> If you want to grab the values before submitting the form you can do
> something like this:
>
> **************************
> Before form
> ***************************
>
> <script>
> function updateCatIDs() {
> obj = document.getElementById('selectedCats');
> for (i=0;i<aSelected.length;i++) {
> obj.setAttribute("value",aSelected.join(","));
> }
> }
> </script>
>
> ****************************
> Start of form
> ****************************
>
> <form action="#cgi.script_name#?#cgi.query_string#" method="post"
> name="editform" onsubmit="updateCatIDs();">
> <input type="hidden" name="bRelatedPagesSubmitted" value="1"/>
> <input type="hidden" name="selectedCats" value="" id="selectedCats"/>
>
> ***********************************************
>
> Hopefully we can get that fixed in the core sometime soon because it's
> a bit of a pain to have to do it on every page that uses the category
> assignment form.
>
> Spike
>
> On Tue, 15 Feb 2005 15:32:53 -0500, Spike <[EMAIL PROTECTED]> wrote:
> > I'm working on a project at the minute that makes heavy use of
> > categories to generate linked data throughout the site.
> >
> > I've just noticed a problem with the farcry category tree. We are
> > using it with quite a large and deep hierarchy. By default the tree
> > only opens to the first level, so you need to expand it to see
> > checkboxes further down the tree that are checked. Unfortunately if
> > you don't do that, the checkbox values are not submitted when you
> > click next in the PLP resulting in lost metadata relationships.
> >
> > The same is true if you expand the tree, check a checkbox and close
> > that node again.
> >
> > From a quick look at the tree code it looks like the checkbox values
> > are retained when you expand/collapse, but they don't seem to be
> > getting submitted for some reason.
> >
> > Surely I can't be the first person to run into this issue!!
> >
> > Does anyone have a simple solution that doesn't involve rewriting the
> > tree rendering code?
> >
> > Spike
> >
> > --
> > --------------------------------------------
> > Stephen Milligan
> > Code poet for hire
> > http://www.spike.org.uk
> >
> > Do you cfeclipse? http://cfeclipse.tigris.org
> >
> > ---
> > You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
> > To unsubscribe send a blank email to [EMAIL PROTECTED]
> > Aussie Macromedia Developers: http://lists.daemon.com.au/
> >
>
> --
> --------------------------------------------
> Stephen Milligan
> Code poet for hire
> http://www.spike.org.uk
>
> Do you cfeclipse? http://cfeclipse.tigris.org
>
> ---
> You are currently subscribed to farcry-dev as: [EMAIL PROTECTED]
> To unsubscribe send a blank email to [EMAIL PROTECTED]
> Aussie Macromedia Developers: http://lists.daemon.com.au/
>
--
--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk
Do you cfeclipse? http://cfeclipse.tigris.org
---
You are currently subscribed to farcry-dev as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/