[dev] [PATCH] turba/add.php

Marc Jauvin marc at r4l.com
Wed Oct 12 13:14:33 PDT 2005


Marc Jauvin <marc at r4l.com> wrote:

> Jan Schneider <jan at horde.org> wrote:
>
>> Zitat von Marc Jauvin <marc at r4l.com>:
>>
>>> I tried removing the "notification" line for the focus, but it does not
>>> seem to work... a way around this would be to use the form name in the
>>> previous code I submitted:
>>
>> It works fine for me. Like with *any* other form generated by
>> Horde_Form. Note that the first field is the drop down list if you have
>> more than one address book.
>
> Hmmm, I don't know why, but this does not work for me. I have a single
> addressbook, but there is still a Drop down that is shown (with a
> single value).
>
> I'm using latest HEAD, so we should be running the same code, right?

OK, here is what I found: the javascript that's generated by the 
Horde_Form to set the focus looks something like this in my case:

  <script type="text/javascript">
  <!--
  try {
      document.horde_form.object[name].focus();
  } catch(e) {}
  //-->
  </script>

I am guessing the "object[name]" will clash with JS arrays... I am 
using the following (default) mapping for my SQL source:

    'map' => array(
        '__key' => 'object_id',
        '__owner' => 'owner_id',
        '__type' => 'object_type',
        '__members' => 'object_members',
        'uid' => 'object_uid',
        'name' => 'object_name',
        'email' => 'object_email',
        'altEmail' => 'object_altemail',
        'alias' => 'object_alias',
        'homeAddress' => 'object_homeaddress',
        'workAddress' => 'object_workaddress',
        'homePhone' => 'object_homephone',
        'workPhone' => 'object_workphone',
        'cellPhone' => 'object_cellphone',
        'fax' => 'object_fax',
        'title' => 'object_title',
        'company' => 'object_company',
        'notes' => 'object_notes',
        'pgpPublicKey' => 'object_pgppublickey',
        'smimePublicKey' => 'object_smimepublickey',
        'freebusyUrl' => 'object_freebusyurl'
    ),


-- 
Marc Jauvin
http://register4less.com
514-905-6500


More information about the dev mailing list