6.0.0-beta1
7/3/25

[#3740] javascript for Horde_Form_Type_assign broken
Summary javascript for Horde_Form_Type_assign broken
Queue Horde Framework Packages
Queue Version HEAD
Type Bug
State Resolved
Priority 1. Low
Owners chuck (at) horde (dot) org
Requester dorm (at) dorm (dot) org
Created 04/05/2006 (7029 days ago)
Due
Updated 04/23/2006 (7011 days ago)
Assigned 04/08/2006 (7026 days ago)
Resolved 04/23/2006 (7011 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
04/23/2006 02:23:02 AM Chuck Hagenbuch Deleted Original Message
 
04/23/2006 02:22:51 AM Chuck Hagenbuch Comment #11
State ⇒ Resolved
New Attachment: assign[1].php Download
Reply to this comment
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't set up right now to preserve keys. See the attached...
04/20/2006 07:01:07 PM dorm (at) dorm (dot) org Comment #10
New Attachment: assign.php
Reply to this comment
Sure.  It'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've stripped out most of the application-specific stuff from it, but 
it is enough that you see how I'm setting up the assign variable.


04/20/2006 05:58:48 PM Chuck Hagenbuch Assigned to Chuck Hagenbuch
 
04/20/2006 05:58:32 PM Chuck Hagenbuch Comment #9
Summary ⇒ javascript for Horde_Form_Type_assign broken
Reply to this comment
Can you attach the code you're using to test this? I can only find one 
instance of the assign type being used, and it's in Occam, which I 
don't have set up. I'll get to it eventually if you can't, but code 
would help me out. Thanks!
04/20/2006 05:13:39 PM dorm (at) dorm (dot) org Comment #8 Reply to this comment
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 + '__values'].value = values;

+    document.forms[form].elements[elt + '__values'].value = values;

  }





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


04/20/2006 04:12:05 PM Chuck Hagenbuch Deleted Original Message
 
04/20/2006 03:17:38 PM dorm (at) dorm (dot) org Comment #6 Reply to this comment
...and the same behavior on Windows IE and Firefox.


04/20/2006 04:20:42 AM dorm (at) dorm (dot) org Comment #5 Reply to this comment
I get Javascript parse errors on js/src/form_assign.js, line 16:   
Error: missing formal parameter at 'var'



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


04/09/2006 12:03:58 AM Chuck Hagenbuch Comment #4 Reply to this comment
Please try this commit:



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



If it checks out I'll merge it to Horde 3.1.2.
04/08/2006 09:08:16 AM Jan Schneider Comment #3
State ⇒ Feedback
Reply to this comment
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's kind of awkward to concatenate them in the PHP code 
first, only to split them later in the js code.
04/07/2006 04:47:42 AM Chuck Hagenbuch Deleted Original Message
 
04/05/2006 11:05:47 PM dorm (at) dorm (dot) org Comment #2
New Attachment: form_assign.js.1.2.10.4[1].patch
Reply to this comment
Sorry, I have a typo in that patch file.  Here is the correct one.


04/05/2006 10:35:41 PM dorm (at) dorm (dot) org Comment #1
Priority ⇒ 1. Low
State ⇒ Unconfirmed
New Attachment: form_assign.js.1.2.10.4.patch
Queue ⇒ Horde Framework Packages
Summary ⇒ javascript for 'assign' type Horde_Form elements broken
Type ⇒ Bug
Reply to this comment
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 
'assign' elements.



I'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't work.



I've attached a patch which obtains the objects through the 
document.forms[...].elements[...] array(s).  It first splits the 
'name' 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.


Saved Queries