<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>javascript for Horde_Form_Type_assign broken</title> 
  <pubDate>Fri, 10 Apr 2026 09:50:16 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/3740</link> 
  <atom:link rel="self" type="application/rss+xml" title="javascript for Horde_Form_Type_assign broken" href="https://bugs.horde.org/ticket/3740/rss" /> 
  <description>javascript for Horde_Form_Type_assign broken</description> 
 
   
   
  <item> 
   <title>The javascript code in js/form_assign.js is broken for movin</title> 
   <description>The javascript code in js/form_assign.js is broken for moving select options back and forth between the two select lists for Horde_Form &#039;assign&#039; elements.



I&#039;ve verified this behavior in Windows Firefox and IE.  I will check on MacOS Firefox and Safari when I get home and will update.



The current code obtains the form element objects through the document[] array, which doesn&#039;t work.



I&#039;ve attached a patch which obtains the objects through the document.forms[...].elements[...] array(s).  It first splits the &#039;name&#039; parater to separate the form and select element names.



This patched code works on Windows Firefox and IE, and I will verify on MacOS Firefox and Safari.

</description> 
   <pubDate>Wed, 05 Apr 2006 22:35:41 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t18622</link> 
  </item> 
   
  <item> 
   <title>Sorry, I have a typo in that patch file.  Here is the correc</title> 
   <description>Sorry, I have a typo in that patch file.  Here is the correct one.

</description> 
   <pubDate>Wed, 05 Apr 2006 23:05:47 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t18623</link> 
  </item> 
   
  <item> 
   <title>The patch looks good and should work in all browser, but I t</title> 
   <description>The patch looks good and should work in all browser, but I think it would make more sense to pass the form and field name separately to the function. It&#039;s kind of awkward to concatenate them in the PHP code first, only to split them later in the js code.</description> 
   <pubDate>Sat, 08 Apr 2006 09:08:16 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t18651</link> 
  </item> 
   
  <item> 
   <title>Please try this commit:



http://lists.horde.org/archives/c</title> 
   <description>Please try this commit:



http://lists.horde.org/archives/cvs/Week-of-Mon-20060403/056494.html



If it checks out I&#039;ll merge it to Horde 3.1.2.</description> 
   <pubDate>Sun, 09 Apr 2006 00:03:58 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t18694</link> 
  </item> 
   
  <item> 
   <title>I get Javascript parse errors on js/src/form_assign.js, line</title> 
   <description>I get Javascript parse errors on js/src/form_assign.js, line 16:  Error: missing formal parameter at &#039;var&#039;



This happens in Safari and Mac Firefox.  I will check on Windows browsers tomorrow.

</description> 
   <pubDate>Thu, 20 Apr 2006 04:20:42 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t19217</link> 
  </item> 
   
  <item> 
   <title>...and the same behavior on Windows IE and Firefox.

</title> 
   <description>...and the same behavior on Windows IE and Firefox.

</description> 
   <pubDate>Thu, 20 Apr 2006 15:17:38 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t19240</link> 
  </item> 
   
  <item> 
   <title>One more:



http://cvs.horde.org/diff.php?r1=1.3&amp;r2=1.4&amp;f=h</title> 
   <description>One more:



http://cvs.horde.org/diff.php?r1=1.3&amp;r2=1.4&amp;f=horde%2Fjs%2Fsrc%2Fform_assign.js</description> 
   <pubDate>Thu, 20 Apr 2006 16:11:56 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t19245</link> 
  </item> 
   
  <item> 
   <title>I still get a couple JS errors with that code, mostly becaus</title> 
   <description>I still get a couple JS errors with that code, mostly because of incorrect var names.  I think this should do it:



--- form_assign.js.1.4  2006-04-20 11:10:48.419915568 -0600

+++ form_assign.js      2006-04-20 10:37:39.825227912 -0600

@@ -47,7 +47,7 @@

         }

     }

 

-    this.setField(name);

+    this.setField(form, elt);

 }

 

 Horde_Form_Assign.setField = function(form, elt)

@@ -79,5 +79,5 @@

     if (hit) {

         values = values.substring(0, values.length - 1);

     }

-    document[name + &#039;__values&#039;].value = values;

+    document.forms[form].elements[elt + &#039;__values&#039;].value = values;

 }





Also, the display of the assign field is not correctly maintained across form submissions.  I&#039;m not sure the __value element is correctly being parsed into the leftValues and rightValues arrays.

</description> 
   <pubDate>Thu, 20 Apr 2006 17:13:39 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t19247</link> 
  </item> 
   
  <item> 
   <title>Can you attach the code you&#039;re using to test this? I can onl</title> 
   <description>Can you attach the code you&#039;re using to test this? I can only find one instance of the assign type being used, and it&#039;s in Occam, which I don&#039;t have set up. I&#039;ll get to it eventually if you can&#039;t, but code would help me out. Thanks!</description> 
   <pubDate>Thu, 20 Apr 2006 17:58:32 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t19252</link> 
  </item> 
   
  <item> 
   <title>Sure.  It&#039;s part of a user profile module I am working on ca</title> 
   <description>Sure.  It&#039;s part of a user profile module I am working on called Bios.  I actually am no longer using the assign field type, either, but I kept the code around for testing/verification of this bug.



I&#039;ve stripped out most of the application-specific stuff from it, but it is enough that you see how I&#039;m setting up the assign variable.

</description> 
   <pubDate>Thu, 20 Apr 2006 19:01:07 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t19262</link> 
  </item> 
   
  <item> 
   <title>The javascript should be all set now. As for preserving valu</title> 
   <description>The javascript should be all set now. As for preserving values, you need to call getInfo() for that to work properly. Also, the assign type isn&#039;t set up right now to preserve keys. See the attached...</description> 
   <pubDate>Sun, 23 Apr 2006 02:22:51 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/3740#t19321</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
